Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
16-11-20 09:39 PM
Hi there,
I thought this would be something simple but I have become stumped and hoping that someone might be able to help?
> I have read a table into a collection
> one of the fields in that table is blank in this example: ID
> I have the ID in a data item
My question is, how do I populate that data item into row 1 of that field within that collection? - highlighted in Yellow.
My intention was to populate row 1 then update the data item and then update row 2, etc....
------------------------------
Lisa Martino
------------------------------
I thought this would be something simple but I have become stumped and hoping that someone might be able to help?
> I have read a table into a collection
> one of the fields in that table is blank in this example: ID
> I have the ID in a data item
My question is, how do I populate that data item into row 1 of that field within that collection? - highlighted in Yellow.
My intention was to populate row 1 then update the data item and then update row 2, etc....
------------------------------
Lisa Martino
------------------------------
Answered! Go to Answer.
1 BEST ANSWER
Helpful Answers
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
17-11-20 02:21 PM
You can use a calculate stage to set the value of a field for the currently selected row. The expression in your example would be [Data Item] and store-in would be Collection from an HTML table.ID. Use a loop to iterate over all of the rows of the collection.
------------------------------
Nicholas Zejdlik
RPA Developer
------------------------------
------------------------------
Nicholas Zejdlik
RPA Developer
------------------------------
6 REPLIES 6
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
17-11-20 08:55 AM
Hi Lisa,
Does your table always have 1 entire field as empty (i.e., in above scenario ID field). If Yes:
There is no option to update the collection field row by row. (i.e., in your case ID field of 1st row then 2nd row etc.)
Instead of that you can append all the Data item values of "ID" field into a separate collection (i.e., in that the collection will have only 1 field and should be with same field name as in your main collection). Once all the Data items were appended to new Collection, remove the ID field in the original collection using "Delete Field" Action in Collection Manipulation VBO, then use "Merge Collection" Action to combine these two collection and you will have your Collection with "ID Field" filled in it.
Please let me know if it is not clear or if I missed anything.
------------------------------
Yeswa Vaibhav Alwar Nerella
Associate Consultant
Capgemini
Asia/Kolkata
------------------------------
Does your table always have 1 entire field as empty (i.e., in above scenario ID field). If Yes:
There is no option to update the collection field row by row. (i.e., in your case ID field of 1st row then 2nd row etc.)
Instead of that you can append all the Data item values of "ID" field into a separate collection (i.e., in that the collection will have only 1 field and should be with same field name as in your main collection). Once all the Data items were appended to new Collection, remove the ID field in the original collection using "Delete Field" Action in Collection Manipulation VBO, then use "Merge Collection" Action to combine these two collection and you will have your Collection with "ID Field" filled in it.
Please let me know if it is not clear or if I missed anything.
------------------------------
Yeswa Vaibhav Alwar Nerella
Associate Consultant
Capgemini
Asia/Kolkata
------------------------------
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
17-11-20 02:21 PM
You can use a calculate stage to set the value of a field for the currently selected row. The expression in your example would be [Data Item] and store-in would be Collection from an HTML table.ID. Use a loop to iterate over all of the rows of the collection.
------------------------------
Nicholas Zejdlik
RPA Developer
------------------------------
------------------------------
Nicholas Zejdlik
RPA Developer
------------------------------
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
18-11-20 03:28 PM
Thank you!! This worked! I used a calculate stage and a loop. I appreciate you taking time out of your day to answer my question.
------------------------------
Lisa Martino
------------------------------
------------------------------
Lisa Martino
------------------------------
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
22-11-21 03:15 PM
This answer is great. But can you can please also tell me how to do this if the field in the Collection is dynamic.
------------------------------
Soumya Behera
------------------------------
------------------------------
Soumya Behera
------------------------------
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
22-11-21 04:22 PM
Use Get Collection Field / Set Collection Field in the Collection Manipulation object. Those two actions accept a dynamic field name and row index. Because they work off a row index, that means a loop is unnecessary; rather, you will want to use a row index and increment it to go over the whole collection (the equivalent of a for-loop).
------------------------------
Nicholas Zejdlik
RPA Developer
------------------------------
------------------------------
Nicholas Zejdlik
RPA Developer
------------------------------
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
22-11-21 04:40 PM
Set Collection Field is working for me. Thank you so very @Nicholas Zejdlikmuch.
------------------------------
Soumya Behera
------------------------------
------------------------------
Soumya Behera
------------------------------
