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
hi anusha/chris, can you please tell how you stored the ac!storedvalues into a Temp variable? I am running into the same issue...
Hi karthip, a 'temp' variable would be any process variable (pv!), with the output of the Write to DS node saving to this pv instead of back into the CDT. This should not be necessary to record the auto-generated ID value however. If you are having similar issues, please post your CDT and Write to DS configurations here.
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.
Does your user have at least viewer access to the process model? They only need initiator to start it, but they would need viewer access to view the resulting variables: https://docs.appian.com/suite/help/latest/Start_Process_Smart_Service.html#permissions-needed