I need to retrirve the unique countries names from data and store it in some variable?

excel
activities

#1

I created a spreadshee which has multiple columns for example:

eg:=-

Name, schoolname, country
rokky ops pak
vergv efvvfe ind
ete erffeef pak
fievne uvnfe ind
rokky ops pak
vergv efvvfe ind
ete erffeef pak
uifbhuve ojveovef USA
fievne uvnfe ind
rokky ops pak
vergv efvvfe ind
ivfn invfi USA
ete erffeef pak
fievne uvnfe ind

I have multiple rows [with corresponding name, age and gender]

there are different people from diffrent countries.
I need to store distinct country names, in a variable and display it using write line.
ie:-
assign UniqueName = {“USA”,“ind”,“pak”}


#2

@Error, Refer this,

Note : Use the query and change the column name.

Regards,
Dominic :slight_smile:


#3

sorry, but i didnt get what you meant there/ \

can yiou give me some sampleor edit my project and send me plz???

Main.xaml (9.5 KB)


#4

@Error, Sorry I couldn’t Upload Xaml. Follow these steps,

  1. You already have a variable named datatable that has all your input from read range activity

  2. Create another variable name arr of variable type String[] (String Array)

  3. Use Assign activity and paste the query right hand side and assign it to arr left hand side,
    arr = (From row in datatable Select Convert.ToString(row(“Country”))).Distinct().ToArray()

  4. Now arr contains your desired output.

Regards,
Dominic :slight_smile:


#5

use the string variable to do that;


#6

@Error

Use Assign activity and paste the query right hand side and assign it to arr left hand side,
arr = (From row in datatable Select Convert.ToString(row(“Country”))).Distinct().ToArray()

To Display this using write line

try this in write line activity,
string.Join(",",arr)

Regards,
Mahesh