Navigation

    APPDRAG Community

    • Register
    • Login
    • Search
    • Categories
    • Recent
    • Popular

    REMINDER

    Please be respectful of all AppDragers! Keep it really civil so that we can make the AppDrag community of builders as embracing, positive and inspiring as possible.

    API Visual Insert - Results

    General Discussion
    2
    4
    318
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • Dick Honing
      Dick Honing last edited by

      Hi there, is it possbile to get some more information/feedback in the result json, i.e. the id of the record created?

      Screenshot 2021-02-20 at 14.23.43.png

      David Alimi 1 Reply Last reply Reply Quote 0
      • David Alimi
        David Alimi @Dick Honing last edited by David Alimi

        Hello @Dick-Honing,

        You can use "SELECT LAST_INSERT_ID();"
        The LAST_INSERT_ID() function returns the AUTO_INCREMENT id of the last row that has been inserted or updated in a table.

        Documentation MySQL here.

        I hope I answer your question well.

        Thank you and have a nice day 🙂

        1 Reply Last reply Reply Quote 0
        • Dick Honing
          Dick Honing last edited by

          @David-Alimi said in API Visual Insert - Results:

          SELECT LAST_INSERT_ID()

          Hi David, thanks! ... but uh ... can I add this code to the API function? And if so, how? Thanks again and best regards - Dick

          David Alimi 1 Reply Last reply Reply Quote 0
          • David Alimi
            David Alimi @Dick Honing last edited by David Alimi

            Hello @Dick-Honing,

            I suppose your function is of type node and I need more information about your function

            But a general example would be like this
            var query = INSERT INTO users SET name='${name'};SELECT LAST_INSERT_ID();;

            Thank you and have a nice day 🙂

            1 Reply Last reply Reply Quote 0
            • First post
              Last post