Additional logic in a 'IF' statement

Currently have a Flow which follows one step of instructions if an item is a new order (New Order Instruction) or another set of instructions if it’s a multiple line order (multiple line instructions)
However I’ve ran into an issue:

This is how it works currently - if OrderID is unique, it translates it’s a new order and carries out the ‘new order instruction’ on the next line it knows it’s the same OrderID and adds the additonal item.
image

But there will be scenarios where the ‘source’ is different on the same OrderID and thus, different account numbers will need to be used so it needs to follow the ‘new order instruction’
image

How can I achieve this? currently my IF statement does the following to determine a new order line or not:
row(“strOrderID”).ToString.Trim = varPreviousOrderID

How can I build in additional logic so if the OrderID is the same as Previous Order ID, but different to the ‘SourceID’ then regard it as a new order.

Hi @steve1977beyond

How about this

row(“OrderID”).ToString.Trim = varPreviousOrderID AndAlso row(“Source”).ToString.Trim <> varPreviousSource

Really appreciate this, when I try to run it though I get the following error:

If Current Order Line is the same as Previous Order Line: Expression Activity type ‘VisualBasicValue`1’ requires compilation in order to run. Please ensure that the workflow has been compiled.

Resolved that error message above by re-adding the " quotations.

Still having issues with the Flow though in that it’s not doing the print sequence after line 1. Essentially because the Flag is different, irrespective of the OrderID, it needs to do a print sequence

We suggest checking if grouping the data and a group member count check will better fit to your case

Thank you for this, although I did apply just a small tweak to get it working:

row(“OrderID”).ToString.Trim = varPreviousOrderID AndAlso row(“Source”).ToString.Trim = varPreviousSource

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.