# Flowchart instead of WHILE Loop

**URL:** <https://forum.uipath.com/t/flowchart-instead-of-while-loop/306259>\
**Category:** Activities\
**Tags:** data-scraping, datatable, question, excel, uiautomation, activities\
**Created:** [April 12, 2021, 6:55pm UTC](https://forum.uipath.com/t/flowchart-instead-of-while-loop/306259 "2021-04-12T18:55:20Z")\
**Posts on this page:** 13\
**Page:** 1

<div class="post-metadata">

**Author:** ![Yudhisteer\_Chintaram1](https://sea2.discourse-cdn.com/uipath/user_avatar/forum.uipath.com/yudhisteer_chintaram1/32/308433_2.png) [@Yudhisteer\_Chintaram1](https://forum.uipath.com/u/Yudhisteer_Chintaram1)\
**Post date:** [April 12, 2021, 6:55pm UTC](https://forum.uipath.com/t/flowchart-instead-of-while-loop/306259/1 "2021-04-12T18:55:20Z")

</div>

Hi,

I actually have a process whereby I need to read an excel file and input data into a website. My process are as follows:

1. Read Range and store in datatable
2. Create a WHILE loop
3. Type Into activities and Click activities inside While Loop

I wanted to know if instead of the While loop we could use a flowchart sequence. Maybe with a counter something like that? Where should we put the Type into activites and so on.

Can anyone help please?

---

<div class="post-metadata">

**Author:** ![Surya\_Narayana\_Korivipadu](https://sea2.discourse-cdn.com/uipath/user_avatar/forum.uipath.com/surya_narayana_korivipadu/32/183050_2.png) [@Surya\_Narayana\_Korivipadu](https://forum.uipath.com/u/Surya_Narayana_Korivipadu)\
**Post date:** [April 13, 2021, 2:01pm UTC](https://forum.uipath.com/t/flowchart-instead-of-while-loop/306259/2 "2021-04-13T14:01:57Z")

</div>

Check this. Here datatable variable name is dt1

 ![image](https://global.discourse-cdn.com/uipath/original/3X/3/8/3898d66fe164121dbdbef69f8a1750fce675afe7.png)

---

<div class="post-metadata">

**Author:** ![prasath\_S](https://sea2.discourse-cdn.com/uipath/user_avatar/forum.uipath.com/prasath_s/32/290219_2.png) [@prasath\_S](https://forum.uipath.com/u/prasath_S)\
**Post date:** [April 13, 2021, 2:24pm UTC](https://forum.uipath.com/t/flowchart-instead-of-while-loop/306259/3 "2021-04-13T14:24:15Z")

</div>

Hi @Yudhisteer_Chintaram1

Why would you use while loop to lopp the data in datatable,we can use **for each row activity** and also if you want a counter for each row activity has automatic counter mechanism built in.

![image](https://global.discourse-cdn.com/uipath/original/3X/2/a/2ab35add9f24ea9de56279a445f03a64946a4c1a.png)

---

<div class="post-metadata">

**Author:** ![Yudhisteer\_Chintaram1](https://sea2.discourse-cdn.com/uipath/user_avatar/forum.uipath.com/yudhisteer_chintaram1/32/308433_2.png) [@Yudhisteer\_Chintaram1](https://forum.uipath.com/u/Yudhisteer_Chintaram1)\
**Post date:** [April 13, 2021, 3:45pm UTC](https://forum.uipath.com/t/flowchart-instead-of-while-loop/306259/4 "2021-04-13T15:45:46Z")

</div>

Yes, I know the For Each. I just don’t want to use any loop.

---

<div class="post-metadata">

**Author:** ![Yudhisteer\_Chintaram1](https://sea2.discourse-cdn.com/uipath/user_avatar/forum.uipath.com/yudhisteer_chintaram1/32/308433_2.png) [@Yudhisteer\_Chintaram1](https://forum.uipath.com/u/Yudhisteer_Chintaram1)\
**Post date:** [April 13, 2021, 3:47pm UTC](https://forum.uipath.com/t/flowchart-instead-of-while-loop/306259/5 "2021-04-13T15:47:46Z")

</div>

Hey thanks man!!!  
I also wanted to know what is the different between

dt1(count)(“column1”).ToString

and

dt1.Rows(count)(“column1”).ToString  
?

---

<div class="post-metadata">

**Author:** ![prasath\_S](https://sea2.discourse-cdn.com/uipath/user_avatar/forum.uipath.com/prasath_s/32/290219_2.png) [@prasath\_S](https://forum.uipath.com/u/prasath_S)\
**Post date:** [April 13, 2021, 4:02pm UTC](https://forum.uipath.com/t/flowchart-instead-of-while-loop/306259/6 "2021-04-13T16:02:21Z")

</div>

I don’t think it’s possible because we are using click and type activities…may be someone will answer this if possible…thanks

---

<div class="post-metadata">

**Author:** ![Yudhisteer\_Chintaram1](https://sea2.discourse-cdn.com/uipath/user_avatar/forum.uipath.com/yudhisteer_chintaram1/32/308433_2.png) [@Yudhisteer\_Chintaram1](https://forum.uipath.com/u/Yudhisteer_Chintaram1)\
**Post date:** [April 13, 2021, 4:05pm UTC](https://forum.uipath.com/t/flowchart-instead-of-while-loop/306259/8 "2021-04-13T16:05:58Z")

</div>

I think @Surya_Narayana_Korivipadu just did it

---

<div class="post-metadata">

**Author:** ![prasath\_S](https://sea2.discourse-cdn.com/uipath/user_avatar/forum.uipath.com/prasath_s/32/290219_2.png) [@prasath\_S](https://forum.uipath.com/u/prasath_S)\
**Post date:** [April 13, 2021, 4:07pm UTC](https://forum.uipath.com/t/flowchart-instead-of-while-loop/306259/9 "2021-04-13T16:07:22Z")

</div>

I thought you don’t want any loops at all ,even this is some kind of loop.

---

<div class="post-metadata">

**Author:** ![Yudhisteer\_Chintaram1](https://sea2.discourse-cdn.com/uipath/user_avatar/forum.uipath.com/yudhisteer_chintaram1/32/308433_2.png) [@Yudhisteer\_Chintaram1](https://forum.uipath.com/u/Yudhisteer_Chintaram1)\
**Post date:** [April 13, 2021, 4:09pm UTC](https://forum.uipath.com/t/flowchart-instead-of-while-loop/306259/10 "2021-04-13T16:09:02Z")

</div>

No, I meant the For Loop, While loop.  
I didn’t explain well I think.

---

<div class="post-metadata">

**Author:** ![postwick](https://sea2.discourse-cdn.com/uipath/user_avatar/forum.uipath.com/postwick/32/227083_2.png) [@postwick](https://forum.uipath.com/u/postwick)\
**Post date:** [April 13, 2021, 6:13pm UTC](https://forum.uipath.com/t/flowchart-instead-of-while-loop/306259/11 "2021-04-13T18:13:24Z")

</div>

A much better overall solution would be to load the data from the spreadsheet into a queue, then use a workflow to loop through the items in the queue. That way if there’s an error while processing one of the records, when you rerun the automation it won’t reprocess the ones that were already done.

And you don’t use a counter with workflows. You use a workflow decision. Basically your logic would be “are there more records to process” and the true line makes it loop back to do the next one while the false line goes to a finish sequence (or nowhere so it just ends).

---

<div class="post-metadata">

**Author:** ![Surya\_Narayana\_Korivipadu](https://sea2.discourse-cdn.com/uipath/user_avatar/forum.uipath.com/surya_narayana_korivipadu/32/183050_2.png) [@Surya\_Narayana\_Korivipadu](https://forum.uipath.com/u/Surya_Narayana_Korivipadu)\
**Post date:** [April 14, 2021, 7:36am UTC](https://forum.uipath.com/t/flowchart-instead-of-while-loop/306259/12 "2021-04-14T07:36:09Z")

</div>

I didn’t observe any difference between these two. May be they are accessing data table as two dimensional arrays. But I always use dt1.Rows(RowNumber).item(ColumnNumberOrColumnName) , as these are standard methods of data table objects.

---

<div class="post-metadata">

**Author:** ![Yudhisteer\_Chintaram1](https://sea2.discourse-cdn.com/uipath/user_avatar/forum.uipath.com/yudhisteer_chintaram1/32/308433_2.png) [@Yudhisteer\_Chintaram1](https://forum.uipath.com/u/Yudhisteer_Chintaram1)\
**Post date:** [April 14, 2021, 11:20am UTC](https://forum.uipath.com/t/flowchart-instead-of-while-loop/306259/13 "2021-04-14T11:20:48Z")

</div>

Okay thanks! Will do that way then!

---

<div class="post-metadata">

**Author:** ![system](https://sea2.discourse-cdn.com/uipath/user_avatar/forum.uipath.com/system/32/182466_2.png) [@system](https://forum.uipath.com/u/system)\
**Post date:** [April 17, 2021, 11:21am UTC](https://forum.uipath.com/t/flowchart-instead-of-while-loop/306259/14 "2021-04-17T11:21:29Z")

</div>

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