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

Question

Question

If any row in a table is negative

asked on July 15, 2019

I am trying to figure out an evaluation for a gateway in forms and am getting the "XPath evaluation may fail for every possible condition". 

I have two tables.  One shows if they are leaving a PO open, the other shows if they are closing a PO.

For closing a PO, the user can pay up to 10% of the overall total.  This works fine, the message displays on my form, and the gateway evaluates correctly.  

So 800$ is above 10% of 481.32.  On submit, the branch evaluates correctly.  This trips my code10flag and the change order check is taken.

 

 

In my other table the rule is they cannot pay more that the budget is for any line.  I have a show/hide rule that displays a warning when this happens and it works.  No matter what line in the table is negative, it show.

It seems that the show/hide rule evaluates like we want in that "if any" of the error values are less than 0, show the warning.

 

However, when submitting this, the gateway fails to evaluate down the branch (screenshot above).  I have already tried setting the End as a default and that didnt work.  Anyone have any ideas as to why or what I am doing wrong.  Basically I need to check if any of those values in the error column are negative.

 

Thanks,

Chris

0 0

Answer

SELECTED ANSWER
replied on July 15, 2019

Okay, so what's probably happening is what I mentioned about gateways not evaluating table rows in the same way as field rules.

With Field Rules, it's using JavaScript to look at each row individually and see if any meet the condition, but with gateways the table variable is just a collection and it doesn't evaluate them separately.

To get what you want for the gateway, you'll need to add a separate field.

You could, for example, add a hidden field that uses the MIN function to get the lowest value. Something like =MIN(code.error)

Then check that value in your gateway instead of trying to use the entire column.

0 0

Replies

replied on July 15, 2019

Where are you getting those variables for the conditions, and what type of gateway are you using?

Gateway Conditions may not work with table rows the same way that they do with Field Rules.

0 0
replied on July 15, 2019

The variables in the Exclusive Gateway?  Just selecting them from the token list to make sure I am getting the right ones.

0 0
replied on July 15, 2019

What exactly happened when you set the "end" branch as default?

With an exclusive gateway you can't have no condition at all, which would explain the XPath error. Setting a default would ensure you have a viable path, but I'm curious what didn't work since you said you tried that already.

0 0
replied on July 15, 2019

Sorry, it takes that default path and Ends.  It should be going down the Change Request branch.  The variables on the instance do show one of them being negative.

The show/hide field does show correctly when one of them is negative.

0 0
SELECTED ANSWER
replied on July 15, 2019

Okay, so what's probably happening is what I mentioned about gateways not evaluating table rows in the same way as field rules.

With Field Rules, it's using JavaScript to look at each row individually and see if any meet the condition, but with gateways the table variable is just a collection and it doesn't evaluate them separately.

To get what you want for the gateway, you'll need to add a separate field.

You could, for example, add a hidden field that uses the MIN function to get the lowest value. Something like =MIN(code.error)

Then check that value in your gateway instead of trying to use the entire column.

0 0
replied on July 16, 2019

Thanks Jason, that was the idea I needed.  I appreciate the option.

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

Sign in to reply to this post.