Retrieve one value from datatable where two values exists

I have a datatable where there could be more than one value in a single cell.

Example datatable:
Region: Divisions:
North 101, 102
West 101
East 101, 102, 103

I need to be able to retrieve one “Divisions” at a time. How can I retrieve 101 from the first row without retrieving 102 as well?

Give a try on

  • For each row actvitivty
    • assign activity| LeftSide: strVal | rigthSide: row(“Divisions”).toString.Split(","c)(0).Trim

With some more details on your requirements we also can adopt it and e.g. creating a modified datatable with split Division cols like

North 101
North 102
West 101
East 101
East 102
East 103

1 Like

Thank you for the reply @ppr . What I have to do is take one “Division” at a time, type into the Division Number Text box, hit the “Tab” key (using a hot key activity), then enter the next division, and hit the “Tab” key. The datatable is a mapping file in order to run the reports correctly for that region.

image

image

Hi @PWilliams
well the main logic would be to split the Division column elements by , and then loop through it and then use the type into activity to type the number along with hotkey Tab

Regards,
Nived N

1 Like

That’s the part I’m having an issue with. Figuring out how to loop through the split.

Well after reading the excel file u are looping through the datatable

Now inside that for each row do the following

  1. Use assign activitiy to split the Division Set:

data = Split(row(“Division Set:”).ToString,",")

Now use for each to loop through each element in data

Inside that for each use type into to type the number as well as using hotkey

Hope this logic help you

Regards

Nived N :robot:

Happy automation

1 Like

That worked. Thank you!

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