Fetching all groupid columns and merging them into one

i have one excel sheet but columns are not defined, id,name,groupid
groupid can be multiple columns i.e.,group id (DYNAMIC) AND FETCH THE VALUES FROM ALL GROUP IDS IN ONE STRINGTASK-3 i have one excel sheet but columns are not defined, id,name,groupid
groupid can be multiple columns i.e.,group id (DYNAMIC) AND FETCH THE VALUES FROM ALL GROUP IDS IN ONE STRING

Hi @MD_Mubarak

Ok, but what is the Unique identifier Value for bot to identify?

Thanks,
Srini

@Srini84 Column Name Group id.

@MD_Mubarak

If the first two columns are id and name always and rest all are group id columms then use the below to get all the group IDs

initialize a str_Groupid string variable with String.Empty

  1. Use for loop with Enumerable.Range(2,dt.Columns.Count-2).ToArray
  2. Inside use assign with str_Groupid = If(str_Groupid.Equals(String.Empty),"",",") + String.Join(","dt.AsEnumerable.Select(function(x) x(currentItem).ToString))

after the loop str_groupid will have all id’s with comma separation

cheers

@Anil_G ok will try it, thanks

@MD_Mubarak

The file you have is an example for the given code already

cheers

@Anil_G ok go it, thanks

@MD_Mubarak

May I know what error you are getting

I am trying to loop through all the columns leaving the first two and get all the data as string and append it in a for loop

cheers

Getting Error And Code Not Running pROPERLY.

@Anil_G I Cleared The Error But Code Is Not Running. After The last Assign Should We Have To Write The output Data In Another Sheet. can you please share a xaml file of it. thanks.

Hello @MD_Mubarak ,

The following steps will help you to solve this.

  1. Use Read range —> Store data in DT1
  2. Use Filter DT to remove ID, Name —> Store data in DT2
  3. Use For each loop for DT2
  4. Create a String variable : TestString
    Use assign activity and assign TestString = String.Join(“,”,CurrentRow.ItemArray)

Input :
image

Output :
image

Please find the below screenshot for workflow details.
image

Regards,
Rohith

ok thank you very much

Can you show the expression in the assign activity?

It’s working fine for me (String.Join(“,”,CurrentRow.ItemArray))

For more details, please check this workflow.

Test12.zip (3.0 KB)

Regards,
Rohith

Yes your UiPath is old version

Hello @MD_Mubarak ,

Check the Currentrow.

In the loop header you’re using CurrentRow and in the expression, you’re using Currentrow, kindly keep the same in both places.

Regards,
Rohith

Same Error In assign Activity. Should I Have To Give Any Default Value. @rohith.prabhu

Thanks.

Add a break point at the assign activity, and run in debug mode.

In immediate panel check for the values of DT, DT1 and currentrow

Ok fine will test it

Check the values in the immediate panel bro.