How to add multiple values of one variable in a single cell? the existing variable is in for each loop

How to write multiple values of one variable in a single cell? The existing variable is in for each loop. the variable value will change in every iteration we have to write that value in a single cell with “+” sign.

Hi @vidya.wagh ,

Could you give an Example of what needs to be performed with sample data ? Having some info in detail as to what needs to be performed will help us to provide suggestions faster.

1 Like

image
as we can see here two values scraped from SAP pasted here in column “k”.

@vidya.wagh

Welcome to the community

I hope this is what you are looking for

Inside the for loop use

First a read cell activity to read the value in the target cell say “F12” and store it in a variable str…

Now use write cell with the same cell as range and value as

Str + "+" + currentitem

Cheers

1 Like

Hi @vidya.wagh
Thanks for reaching out to community.

You can go through the following steps,

Initialize String variable as “outputString”.
Then a For Each loop to iterate through your variable.
Assign activity to append the current value with “+” to the “outputString” variable.
Assign activity to remove the last “+” from the “outputString” variable.
Write Cell activity to write the “outputString” variable to the desired cell.

Happy Automation :grinning:
Please mark this as a solution if it helps you. :writing_hand:

Regards,
@pratik.maskar

1 Like


All the activities are in for each row in data table. the value of get ocr text will change every time. we have to add those values in a cell with “+”. for more understanding please see above screenshot of excel.

@vidya.wagh ,

If you are already using a For Each Row Activity, then I believe we could use the below Expression to update the value in the K column :

CurrentRow("Your K Column Name") =CurrentRow("Your K Column Name").ToString+" + "+YourOcrOutputVar 

The above expression is to be used in an Assign Activity.

Check if the above could be implemented in your workflow and if it helps in solving your problem.

1 Like

Thank you so much it works. :handshake:

1 Like

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