You are viewing limited content. For full access, please sign in.

Question

Question

Parsing submitted form Tables in a workflow

asked on May 8, 2023 Show version history

I have a table that has rows in it that are being populated by a lookup on the forms side.  

In the workflow, I need to be able to query on this field to update a table in a database - Each row value is a column in the database (there can only be one value per row per class)

example
Name               Value                Class

Test1                 Pizza                 Food

Test2                 couch                Furniture

 

I need to update a SINGLE row in SQL  

Update SQLTable set  Furniture = 'Couch' , food ='Pizza' where BP_Instance_ID = ID 

 

Table result

ID         Furniture        Food    

1            couch            Pizza

or something like that - doesn't have to be in SQL can be workflow, just not sure on the 'how' to do  this.  

I have set up a for each value, but I actually don't know how to query the token set once it's created to determine how to use each to update a row.

Does anyone have an example of how to do this in the Workflow?

 

Thoughts and Ideas are appreciated

0 0

Replies

replied on May 8, 2023

Because the name of the database column that you are updating is being pulled from the actual data on your table from Forms, you're not going to be able to use the "Update Data" activity in Workflow, because you are selecting (hard-coding) the columns when you are setting up the activity.

But you could do this with a "Custom Query" activity.

Assuming you are connecting to your database via ODBC connection, it would look something like this (ignore the red highlighting, since I was just mocking this up, I didn't actually create a table with those fields, so the tokens don't exist in my environment, but they should in yours):

 

1 0
replied on May 8, 2023

Note, that's its a lot easier if you can structure the table in Forms to be basically the same as your table in the database.

So instead of this:

Name               Value                Class

Test1                 Pizza                 Food

Test2                 couch                Furniture

 

You have this:

Food                Furniture

Pizza                couch

 

In this case, we have a single row of data with two columns, instead of two rows with one column each, and the names of the columns are fixed, so we can use the "Update Data" activity in Workflow instead of having to use the "Custom Query" activity.

0 0
You are not allowed to follow up in this post.

Sign in to reply to this post.