IF + Dictionary<String, Double>

Dear all,

Please take the attached project, run the workflow Rename and Sort Invoices and at the first activity (Select Folder), please select the folder Invoices.
Process Invoices2.zip (441.4 KB)

The folder contains invoices in CAD, USD and RON.
In the sequence “Sequence get xRate for invoice in foreign currencies” I try to obtain the following: if I already searched on Google for the exchange rate CAD (for instance) - EUR, not to search again if I find another invoice with the same currency.
If the foreign currency is new, to add it in the dictionary rates <String, Double> , where the key is the currency ISO and the value is the xrate with EUR.

However, the robot never chooses the middle path (not to search again for the same xrate). It only goes on the left or on the right path.

I know it’s a lot to digest. But if some of you have time, please help me!

Hi Cardon,

The only thing I can think of is that the ‘rates’ dictionary value is not expanded out enough to contain the values you want to hold.

As per the picture below, the variable is only within the ‘…get xRate’ scope. You might need to expand the scope to ‘Body for each invoice’ or ‘main scope’. That way, the key values will be kept and stored throughout the automation.

1 Like

Hi @Thom_Co
Thank you for taking the time to review my question. It didn’t work when I extended the scope of rates to ‘Body for each invoice’, but it worked when I extended it to the main sequence.

Not sure why was necessary to make it global variable, but I’m happy and grateful it worked.

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