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

Question

Question

Forms Inclusive Gateway based on a table row having "Current Date", can this be done?

asked on June 30, 2023

Is it possible to have a gateway only take a branch if:

1) /dataset/Department="Planning & Development" and

2) /dataset/OpenWorkOrdersTable="checked" and

3) /dataset/WorkOrderTable.Date="Current Date"

I have this working in a form with 1 and 2 criteria, but it kicks off the workflow branch every time the form is submitted even if there is no new row added to the work order table.  I need to add that third criteria.  I need the workflow to start ONLY if there is a new row in the table with today's date.  I don't want the workflow sending data to the hidden database if there are no new rows in the table.

0 0

Answer

SELECTED ANSWER
replied on June 30, 2023 Show version history

I would probably handle this with an external field and a formula/calculation because you need to isolate a specific value from the table.

For example, you could use a hidden number field to count how many rows have a date matching today, then you can use a >0 rule in your gateway (just make sure the field is numeric).

=COUNTIF(MyTable.Date,TODAY())

The TODAY() function returns the current date value with no time portion, and by adding that into the COUNTIF you get a count of rows that match.

You could combine this with other formulas like an IF to get a true/false or something else if that helps make your conditions easier to understand, but the countif would be a good starting point.

Just make sure your hidden field is set to Save the value.

 

There's more you can or might need to do if it always has to be the last row and you need to enforce that or something, but hopefully this will get you going.

 

EDIT: I just wanted to note that this also works with read only fields that have the default date set to the current date. Although the value is technically tracked at submission, the form does get a value so the calculation still works.

2 0

Replies

replied on June 30, 2023 Show version history

I don't think you can make the gateway check the value in the table the way you are attempting.

It might be easier to call the workflow every time, and then wrap all of the activies in the workflow within a Conditional Sequence that checks for that value in the last row of the table.

Edit to Add: this is a few screenshots getting a date from the last row of a table, storing it in a token, and then checking if that token is equal to the current date:

1 0
replied on June 30, 2023

Thanks, guys!  Signing off now for a four day weekend.  Happy Canada Day!

Looking forward to trying out these suggestions next week.  Will let you know how it goes!

0 0
replied on July 5, 2023

Jason, it works!  I have used the formula you provided and popped it into a hidden field, changed my Inclusive Gateway instructions and tested, and it works!  Yeah!  Thanks!

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

Sign in to reply to this post.