How to get id of inserted record inside process model?

Scenario: 

Insert record in to DB and return the record details back including the index ID of the record.

How to get the Id and save into process variable?

I have tried to save ac!storedvalues into target process variable, but the variable is not having ID value when it passed to user input task (the next step after writing new record to DB).

Please see the screenshot of the process model for nodes being used and the configuration of output of write to DB smart service.

The script task in the below image is not configured and is empty. please ignore this node. immediately after write to db the next node should be user input task.

Please share a recipe or screenshot how to get dynamically the new entry record ID

  

  Discussion posts and replies are publicly visible

Parents Reply
  • Chris, thank you. but here is the issue I am facing in 18.2.  The ac! stored values is stored into a pv!StoredValues and the process returns to the UI (a!startprocess on a buttonwidget) after saving the record.   Activity Chaining is enabled.

    In the onsuccess event of the a!startprocess on the UI, I am checking for

    isnull(fv!processInfo.pv.StoredValues)

    and if null displaying an error msg, if valid then I am displaying a success msg before proceeding to refresh the UI.  

    It works fine for me as an admin.  But it displays error msg for user.  Meaning the isnull check above fails for user EVEN THOUGH HIS RECORD IS SAVED.  There is no error in process model in Monitoring page.

    NOTE - For the Save button I have set submit to false so that the user stays on the same page after the submit.  Could this be the issue.

Children