Condition Based Data Picking from Excel File

image
this is my intial excel data/sample given data

Each id is a single trx. and the corresponding code need to be picked from here to input in system. If there is multiple id like 789 then the requirement is to pick all of the three at a time.

I also need to keep track that 123,456 are single trx entry and 789 is multiple.

How may I perform this action easily and express my output through a typeinto activity under a for each dt loop?

Expected Output

IF, I am working with 123 → result treg
IF, I am working with 789 → result
tonh
lijn
kolp

Hi @Tanzill_Ahsan,

you can use the Type Into activity within a For Each loop to achieve this.

First, you need to create a list of the IDs from your Excel data. Then, use a For Each loop to loop through each ID. Inside the For Each loop, use an IF statement to check the value of the current ID. If it is equal to 123, use the Type Into activity to type “treg” into the system. If it is equal to 789, use the Type Into activity to type “tonh”, “lijn” and “kolp” into the system.

You can also use the Write Line activity to log the IDs that have been processed and the corresponding codes that have been entered. This will help you keep track of which IDs are single trx entries and which are multiple.

Thanks,

@RajKumar_DC

this is sample dataset and all of the values are dyamic. I am also not familar with list,do you know any way to solve it through datatable?

Hi @Tanzill_Ahsan

Yes, you can use a For Each Row activity with a DataTable to loop through the IDs and input the corresponding code.

First, within the For Each Row loop, use an Assign activity to store the value of the ID from the DataTable into a variable. Then, use an If activity to check the value of the ID. If the ID is 123, use a Type Into activity to type “treg”. If it is 789, use a Type Into activity to type “tonh”, “lijn”, and “kolp”.

@RajKumar_DC thanks

but the values are not fixed like, 123 or treg nothing is fixed, if my values are fixed that it wont be much a problem for me to sort out

all of the values are dynamic which will update after 24 hours

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