How 2 Change RowItem if Match Value in Config File(.xlsx)

How 2 Change RowItem if Match Value in Config File(.xlsx)
in Condition :
if Row.Item(1) = A
Add Row.item(3)=123

1 Like

Buddy @nuttapong_ludloy
Welcome to UiPath community buddy

  1. Once you read the excel with excel application scope and read range activity and getting the output with a variablename outdt
  2. Then use for each row loop by passing the above variable outdt
  3. Inside the for each row loop use a if condition like this buddy
    row(1).ToString.Equals(“A”)
    If this condition passes , in THEN part of if condition mention like this buddy… with assign activity
    row(3) = “123”

Thats all buddy you are done
Kindly try this and let know whether this works or not buddy
Cheeers @nuttapong_ludloy

Thank you so much @Palaniyappan

1 Like

Did that work buddy @nuttapong_ludloy

Yes, It’s Work for static value but in my workflow using of Dynamic value from Config File.if you have any idea.pls let me to know.Thx

1 Like

use in_Config(“Configured string”) for checking. :wink:
นะครับ

buddy may i know which value is dynamic here @nuttapong_ludloy

Example
Column1 | Column2
A1 |
A2 |
A3 |

in this case. Can use A+i for Loop find Column1 Value. Not right?

1 Like

no worries buddy @nuttapong_ludloy
while you are iterating with for each row loop you can check with this if condition itself buddy as the for each row loop will iterate through each row one by one and we have used the if condition within the for each row loop with condition like row("Column1).ToString.Contains(“A”)
and this contains will check even the string in each row of that column contains the letter “A”, no matter what A1 or A2 or A3

this would work buddy
Cheers @nuttapong_ludloy

Thank @Palaniyappan for idea to Check Value.if Column1 have some value is not contain ‘A’.what concept to check this condition.and last question if Column1 value is match.I want to add data to row with another value.

1 Like

Same buddy to check whether the column1 doesn’t have “A” , we can do like this in if condition buddy
Not row("Column1).ToString.Contains(“A”)
then if the column1 value is matched with letter “A”
you can add value value to any column in that row
like if you want to add in column2, if column1 has a letter “A” then inside the THEN part of if conditon put like this buddy using assign activity
row(“Column2”) = “the value you want to add”

Thats all buddy
Kindly try this and let know buddy
Cheers @nuttapong_ludloy

Hi @Palaniyappan;
In my example workflow in Column1 have
{A,B,C,D,E} and all value must be to check for add data

if Column1=A
then insert Test1
and then for each row to Check all value

you can advice to me.Thx

Yes buddy of course
in the if condition mention like
row(“Column1”).ToString.Trim.Contains(“A”)
if this condition gets passed you can insert the value Test1 to any column you want with an assign activity in THEN part of if condition
like this
row(“your column name were you want to insert”) = "Test1"

Cheers @nuttapong_ludloy

did that work buddy @nuttapong_ludloy

Yes,It Work. Thx @Palaniyappan

1 Like

Fantastic buddy @nuttapong_ludloy
Cheers
kindly make a solution buddy @nuttapong_ludloy