How loop the process until the column is null

Hi every one i need to add the some numbers to the accounts in a web application but for some accounts we have to add 5 numbers like 2434345,324324,234324,7892,2554565 and for some accounts 3 numbers like 87904,3489387,3434 so to add the each number we need to type the number in the text box and should click add button to add second number we should again type number in text box and click add button so the loop should automatically go to next column of same row and should add the number until the column is empty so how to loop this it should go automatically to the next column and add the number if column is empty should come out of the loop and should go for next step

2 Likes

Hi @bpt.teja1996

you can add this to array 2434345,324324,234324,7892,2554565 delimited by comma

and use Foreach Activities to iterate in the array.

cheers :smiley:

Happy learning :smiley:

5 Likes

hi @pattyricarte the numbers are not constant and same it changes for 10 to 20 also so it would be better to check the column and repeat the loop until next column is empty as my view

2 Likes

@bpt.teja1996If I understand correctly, the adding of the number is dependent on the number of rows the data exists in the application. Please send the screen shot of the application for clear understanding.

Approach 1:

  1. Extract data from the application into a datatable and loop through each row to add numbers.

Approach 2:
In the current approach, on clicking add button, the control is automatically going to the next column.

  1. Once the control reached to next column, Use hot key, Ctrl+A to select the value.
  2. Use Copy Selected Text activity to copy the value into a variable. (say variable name as CopiedValue)
  3. Check is value exists, not String.IsNullOrEmpty(CopiedValue), Proceed adding the value
  4. Otherwise end the process.

Hope this helps.

6 Likes

Hi @Madhavi can you please provide any example flow i was new to UI path

2 Likes

@bpt.teja1996 The process depends on your application behavior. Can you please try following the steps. And send the workflow after that. Will review and correct the errors.

1 Like

Hi @Madhavi how to write the expression in if loop to check weather the next column in empty

1 Like

if(not String.IsNullOrEmpty(CopiedValue)) => column is not empty
CopiedValue here is the variable to which you have assigned the value copied from the column cell(Step 2 in the precious post).

1 Like

image hai @Madhavi this is the image and this is the excel sheet

2 Likes

@Madhavi i have given for example that usually we have very large number that P1,P2 are the columns to be added for some it would be up to 4 numbers gor dome 20 for some 100 so can you please give me a sample flow please it would help me lot

1 Like

If you are reading data from excel and updating it, use datatable activities.

  1. Use read range activity to read the data from excel. Output will be a datatable.
  2. Use for each row activity and loop through each record
  3. Inside the loop, check for the condition if there any and
    you can directly update P1 & P2 column values in the data table and then once all the records are processed, you can write them into the excel back use write range activity.
    or on each record processing, use write cell activity and update the column values.
2 Likes

@Madhavi sorry i i have CSV file and

this the work flow i created but it was not working

Can you please send the workflow?
You dont need to do datatable.Rows(count+1) if you use for each row activity. That gives a direct access on the row.

1 Like

seee

1 Like

hai can you please edit it

1 Like

@Madhavi can you please edit it i was not getting how to do it

1 Like

find_empty.xaml (19.1 KB)

1 Like

If you can send me the workflow, i can try editing it and send it back.
If you dont want to post it in public, send though the message option.

1 Like

please check it it was at the top @Madhavi

1 Like

@ have you found it …?

1 Like