Best way to have bot only process marked rows

Hi!

I am working on a bot that will take data from an excel spreadsheet and update SAP. The spreadsheet will be reviewed by humans and they will mark the rows that the bot can update. I am thinking I will just lock down the spreadsheet and add a column to it for them to indicate the ones for the bot to update. The values in that column could be ‘x’ or ’ ‘. Then I need the bot to only update SAP for the ones with the ‘x’. Two questions: is the ‘x’/’ ’ column the best way to indicate the rows to update for the bot? Also how to I get the bot to only use the rows with the x?

So far I have an excel application scope, read range with that sheet and then a for each row.

Thanks for your help!

Scarlett

Hello Scarlett,

I think the ‘x/’ ’ is a good idea. Easy to maintain.
You only need an if-statement which checks the content of a column(in my case this is called ‘selected’. If this column and row contains the letter A(or X in your case), you either do some operation or do nothing to this row.

Hope this helps,

See attached workflow

You can achieve this easily by using an if to check wether the value contains “x” or " ".Main.xaml (9.7 KB)

1 Like

1 Like

Hi @sdickson,
That is a good way to start :slight_smile:
So what you need is just add an If activity inside the For Each Row.
The condition is row(“ColumnName”).ToString = “x”.
If True, update :slight_smile:
Hope this helps :slight_smile:
Despi

2 Likes

I would just change the if condition so it looks only in the column specified. So it would be row.item("[Column Name]").ToString = “x”

1 Like

Thanks for the help! This seems to be working! :slightly_smiling_face: If I don’t want to do anything with the rows without an ‘x’, do I leave the else side blank?

Thanks all of you for your help! @Smith93, @Jan_Brian_Despi, @Dave

2 Likes

Yes, just leave it blank :slight_smile:

1 Like

It would go even faster if you filter the datatable you are reading for the rows not containing x and then you process all the remaining rows

1 Like

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