How to extract data from a Gridview control to WorkflowGen process data?


#1

Issue

How to extract data from a GridView control to WorkflowGen process data?

Solution

If you require data from within a GridView control to be stored within a process data in WorkflowGen, you can do this by accessing specific information from the GridView. Keep in mind that GridViews are dynamic, meaning that they can contain zero or multiple rows of data, whereas WorkflowGen process data is static.

The following example will extract a specific data element from a specific row of the GridView and pass the value back to WorkflowGen.

Suppose you have a GridView called GV_USER with 3 columns: ID, Name, and Details, each containing a textbox control with the ID GV_USER_USER_ID, GV_USER_USER_NAME, and GV_USER_USER_DETAILS respectively.

Furthermore, the user has entered 5 rows of data. If you need to extract the Name from the first row of data, do the following:

  1. Create a process data (ex. FIRSTUSERNAME) to store this particular GridView value.

  2. Create an OUT direction action parameter with the proper syntax (GRIDVIEW_ID[x]/ELEMENT_ID). In this example, we would create a parameter with the name GV_USER[1]/GV_USER_USER_NAME.

  3. Set the OUT parameter to receive the value into the process data FIRSTUSERNAME.

Notes

  • In the GRIDVIEW_ID[x]/ELEMENT_ID format, GRIDVIEW_ID is the .NET ID of the target GridView and x is the row index of the GridView data row. It is not zero base, meaning the first row is 1, not 0. ELEMENT_ID is the .NET ID of the control (textbox in this case) within that row.

  • In the event that the GridView has no data or the row index that you specify does not exist, WorkflowGen will just set the process data to null.