I need to pull the highest "ID" number from SQL

Certified Associate Developer

So I have a SQL table with an ID number, I need Appian to pull the highest number and add 1 to that.

Thank you

  Discussion posts and replies are publicly visible

Parents
  • 0
    Certified Lead Developer

    Usually for this I'd just do a standard Query Entity, using a PagingInfo configuration with startIndex and batchSize both set to 1, and a sort configuration set to sort by your ID, Descending... then grab the ID in question from the result.  To slightly further streamline the query, you can set it to retrieve ONLY the ID column in the query result, useful if the table in question has more than a handful of columns.

Reply
  • 0
    Certified Lead Developer

    Usually for this I'd just do a standard Query Entity, using a PagingInfo configuration with startIndex and batchSize both set to 1, and a sort configuration set to sort by your ID, Descending... then grab the ID in question from the result.  To slightly further streamline the query, you can set it to retrieve ONLY the ID column in the query result, useful if the table in question has more than a handful of columns.

Children
No Data