How to Add String Variable values(scrapped values) from for each Datatable loop can be added as colmnn of datatable?

AcessWorkItemDetail.xaml (30.5 KB)
Here in this workflow i 'm scrapping ClientId, AccountNumber and AccountAmount from ACME website now i want to store this information in form of datacolumn in out_WI1Task datatable or in another datatable because after i want to upload this data to a orchestrator queue later. Can anyone guide me how to add ClientId, AccountNumber and AccountAmount to a datatable?!

If you already have the data in a datatable (you’re using For Each Row) why do you need to add the data to another datatable?

1 Like

Hi @Vidhi_Patel

You can use add DataRow activity inside your loop.
Then you can use the variable of the loop (e.g. CurrentRow) and the name of the table you want to store in. These are to be added to the activity: Add Data Row

1 Like

Let’s consider why she is trying to loop through a datatable to add data to another datatable and then into a queue, and why the original datatable can’t just be used to add to the queue.

Because i only need this three field in orchestrator queue . so later i can just add this datatable data in a queue. i’m working with Dispature part in Reframework.

hey , @Dawodm thank you for responding , i have single variable value for first iteration of loop , i don’t understand how to add each of those value in mass like in form of datarow or arraylist , instead how about using Update ro item activity, which one is better option in your opinion ?!

Hi @Vidhi_Patel

As @Dawodm pointed , You can use add data row to add data to another datatable in a for loop

say first table is dt and you have loop on current Row

Add in arrayList - {CurrentRow(“Column1”).tostring,CurrentRow(“Column2”).ToString…}

Alternately after you have all the data you can use remove data column to remove unnecessary columns and use a bulk add queue item to add all the data in one go

cheers

1 Like

Hey @Anil_G Thanks a lot for making me understand. :blush: :pray: ! Cheers!

1 Like

But before using if i’m using current table then first i need to add columns and if i build different datatable then i need to use build datatable activity first. isn’t it?!

Hi @Vidhi_Patel

Yes if you need to use a different datatable you need to first use build datatable to create what columns you need and then in loop you can use the add data row

cheers

1 Like

You can use Filter Datatable to keep just the columns you need, and do it all right in the original datatable - no need for a second one (unless you need the rest of the columns for something else)

1 Like

It would be much simpler to just use Filter Datatable and keep the columns she wants.

1 Like

HI @postwick

Agreed but she is trying to use it in dispatcher. So each iteration will be separate it would be better to use add data row

cheers

Using it in a dispatcher is irrelevant. Each iteration will not be separate, that’s what Bulk Add Queue Items is for.

1 Like

Hey @postwick Thank you for your assistance as well , i solved that problem! :slight_smile: Cheers!

1 Like

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