You could probably achieve this with an array and putting each value in the array as a variable in the dt.Select method as @pathrudu advised.
For example:
Client requires USD and GBP. Have the currency array set up as USD;GBP (or USD,GBP) as long as the delimiter is constant. Then split into an array with Split(yourList,";"c) ← if the delimiter is a semi-colon.
Then in a for each loop, perform the dt.Select method on the original data, and for each array of datarow output you could add to a new datatable. I haven’t played around with it but you would need to initialize the datatable first and it depends on whether you want the headers in the new, filtered datatable. You won’t be able to use the .CopyToDatatable method as this would overwrite anything already in there.
Using an array for the currencies in this way would ensure the process can run correctly whether the client has requested any number of different currencies in any combination.
To use a variable in the dt.Select method it would be something like
Asset or config file, enter the currencies your client wants to see.
CurrencyArray(var type: string) = USD;GBP;AUD
At the start of workflow, split this into an array.
yourArray(var type: array of string) = Split(CurrencyArray,";"c)
For each Currency in yourArray
DatarowArray(var type: array of datarow) = yourDatatable.Select(“[Column Name]=‘”+Currency+"’)
Add to datatable activity: (DatarowArray into yourNewDatatable)
This should loop 3 times, as there are 3 currencies to grab from the main datatable.
The new datatable variable will need to be initialized (new system.net.datatable I think off the top of my head?) because you are not grabbing it from a range.
This new datatable, once filled with the relevant rows of data, can then be written elsewhere or manipulated further. It has been filtered based on the currencies your client requires.
Apologies if my explanation is lacking - I’m not very good at putting code into words!
It’s difficult to understand what you are trying to do because I don’t have context of the process.
You can achieve the dynamic currency requirements by playing around with the arrays, my solution won’t fit yours perfectly but some form of it should be suitable.
Also please review the values left in your variables as I believe you have just accidentally given me your email and password.
In the above assign activity, am writing manually the currencies using string format method and the “transaction item” has all the currencies. How can I get which ever currency the client need?
it’s not necessary to install any activity you may need to re-do the process. please see the screen shots for the activities you are missing this may happened due to version difference. as you already have for each and invoke method activities.