How do you read a single record from a SQL table based on its primary key and store it in an object variable in a workflow.
I can get a collection of 1, but cannot extract the record into an object of the same type as the table. It only allows me to extract it to a workflow variable.
I would like the same functionality as for SharePoint: ie ‘Retrieve an item’
Best answer by Garrett
Hi @lvangemst
Example (Using Azure SQL for database)
Query SQL. Save result into obj_SQL_Query variable Using condition ID equals <ID> which returns exactly Zero or 1 record.
Use Loop for each to process obj_SQL_Query → Rows collection. Loop will exit if there is ZERO item in the collection
Inside the Loop for each, You should be able to retrieve values similar to SP Retrieve an Item. Note: The values in Current item are my example table column names. These values will differ from your table.
Query SQL. Save result into obj_SQL_Query variable Using condition ID equals <ID> which returns exactly Zero or 1 record.
Use Loop for each to process obj_SQL_Query → Rows collection. Loop will exit if there is ZERO item in the collection
Inside the Loop for each, You should be able to retrieve values similar to SP Retrieve an Item. Note: The values in Current item are my example table column names. These values will differ from your table.