Skip to main content
September 29, 2023
Question

Update table with a loop in a Process Model

  • September 29, 2023
  • 10 replies
  • 0 views

Hello all - 

I have a process model, where the first task is to call the database for a view (image1).

This view has a unique column that is saved to a CDT with other columns (roleid and rest of columns).

I save the output of the query database results to an array variable that has the view CDT.

My next task would be to iterate through the array variable to update the table that matches the roleid.

How can I loop through each array with roleid from the variable and match it to the table roleid? I don't think using a Query Database with the following is correct as the variable propert doesn't seem accessible.

Thank you for your help.

10 replies

mikes0011
Brainy
September 29, 2023

First and foremost I recommend you completely abandon use of the Query DB node you're using here, and replace it with Query Entity and Write to DSE node(s) as needed.  There is absolutely no reason I can see that you should be using Query DB here.

alexl0007Author
September 29, 2023

There is no Query Entity in process modeler, even when I search for it.

mikes0011
Brainy
September 29, 2023

Query Entity is not a node - you merely use a!queryEntity() in the Data Output tab of a script task (or any other sort of node, when appropriate).

My standard Best Practice is to create an Expression Rule preconfigured to do a basic query (with a few basic filters) for every individual table and view, and then it's just a matter of referencing that expression rule in your process model, instead of configuring a brand new a!queryEntity() statement.  But either method will work.