How to make the condition met


Im having trubles to stop the loop in a incoming invoice exersice. The automation runs and never stops :smiley:

I havent used the “do while” activity. I have just connected the process an invoice sequence back to the flow desicion. The flow desicions condition is numberOfInvoices>0 and the value is numberOfInvoices -Int32-2

This is probably something very simple that im too blind to see. Right now i could use any tips u have…thankyou

Can you share your zipped project folder?

Make sure you’re actually decreasing numberOfInvoices every time you process an invoice. If you don’t then it will always be 2, so the condition will always be true.

Sorry, new users can not upload attachments. Unforunately i can not:(

Then as Merita26 said, make sure the value of numberOfInvoices is assigned to numberOfInvoices - 1 at the end of your Process an invoice flowchart. Since this is a flowchart, make sure the value is being decreased regardless of which flow path the flowchart takes. You could even have it do this between the transition from Process an invoice to the condition.

Check 2 things:

1.) Make sure you’re only decreasing the value of numberOfInvoices one time. If you’re decreasing it 2 or more times, the process will only run once.

2.) Make sure you don’t have numberOfInvoices defined twice (once in the Automated invoice process scope and again in a lower scope. You’ll know this is happening if you see the variable twice in your underlying Process an invoice flowchart where you’re changing the variable. There will be 2 variables, and each will have a warning sign next to them. You only want to keep the global one.

How can i make the automation run through the process an invoice sequence which contains the following

I want to end the loop in accounts payable system or manual processing folder.

I don’t see where you’re decrementing numberOfInvoices, but you can do this immediately after Start. Then your process will only run twice as long as you’re not reassigning it anywhere else.

I changed the default to -1?? in the numberofinvoices variable

If you have only 2 invoices (and you know it will always be 2 invoices), the default should remain as 2. Use an Assign activity in your process flow, and set numberOfInvoices = numberOfInvoices - 1 after the Start of the Process an invoice flowchart. As long as you’re not updating the value anywhere else, the process will run twice before reaching the end state.


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