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

Question

Question

Remove Excess Table Rows When Populating via Workflow

asked on May 24, 2022

I have a Form (Forms 11.0.2 using NEW designer) that upon submittal, runs a Workflow, waits for the Workflow to complete, and then moves to the next approval step.  The Workflow pulls data from the Form and sends back data to populate a table.  This process of updating the table variables by Workflow happens after each approval until the process is complete.  The process works fine so long as the number of rows in the table it is populating remains the same or increases.  The problem comes if there are now less rows for it to populate than previously.  While it updates the rows it has data for, it ends up leaving the extra rows and not removing them.  

 

Here is an example.

  1. I submit a form & workflow populates a table with 4 rows
  2. Someone else approves the same form and workflow now populates only 3 rows
    • The first 3 rows update correctly but the previous 4th row remains instead of being removed

 

I know I can clear ALL rows from a table in Workflow by setting every column in the table to %(DB.NULL) when sending back Business Process Variables.  Has anyone found a way in Workflow to either:

  • Clear a table and then repopulate it
  • Repopulate a table and have any excess rows removed
0 0

Replies

replied on May 24, 2022 Show version history

I thought I might have the answer by passing values to variables more than once in the same "Set Business Process Variables" activity.  Thus to I passed this into the form via the activity:

Table.Name=%(DB.NULL)
Table.Email=%(DB.NULL)
Table.Name=%(NewNames)
Table.Email=%(NewEmails)

Thus I cleared the table out first (first two lines) and then passed in my multi-value tokens to populate it (second two lines).  

This worked so long as all of the data it was repopulating the table with was new.  If any of it was the same as was previously populated then it removed it but left a blank line in its place.  So close but I will keep trying.

0 0
replied on May 25, 2022

The only way I've ever figured out how to do it is with two separate workflows, with Forms calling them in sequence (and set to wait for completion).  The first one doesn't do anything except sets the table values to %(DB.NULL), and the second workflow populates the corrected values into the table.  Unfortuantely, this is assuming the table is just loading data from another source, like a database, and I don't need to manipulate the data in the table in that second workflow (since it was removed in the first one).

0 0
replied on May 25, 2022

That's what I came up with as well but was hoping that someone had found a better option.  I am going to try a few different variations and see if I can nail down a way to do this in a single workflow.  Thanks for confirming your method and hopefully Laserfiche see's this and builds in a better option in future versions.

1 0
replied on May 25, 2022

If you can make it work in a single workflow, please share, because I've tried a lot of different stuff to get it working, and never have been able to.

0 0
replied on June 3, 2022

I tried a ton of different methods but like you, the only way to get it to consistently work is by triggering the workflow twice (once to clear the table and again to fill it).  Hopefully this is something that gets added/updated in a future release.

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

Sign in to reply to this post.