How to give Column Name in Select Item if using DataTable as List in Uipath Apps

Hi,
What do I Give Column Name if using DataTable in List Source.

Thanks in Advance!!!

Hey @Daniyal_Tahir
When using a DataTable as a list source in UiPath Apps, you need to specify the exact column name from which the dropdown values should be taken.
Make sure the column exists and the name matches exactly, Apps is case-sensitive.

The column name is “Full Name” in DataTable.
Should I just pass the exact Column name only? Or is there a query to pass the column name?

@Daniyal_Tahir
Yes, you should just pass the exact column name as a string - in your case, simply write:

"Full Name"

There’s no need to use any query or expression. Just make sure the column exists in the DataTable and the name matches exactly, including spaces and capitalization :slight_smile:

Perfect!!!
Just one query

My DataTable have 3 Columns

“Country”, “D.O.B”, “Full Name”

The Dropdown List is only picking the Values from DT when passing the 1st Column Name “Country” but showing blank for the rest of the two.

Below is the expression in List Source:

What changes do I need to make in expression editor so that my DataTable should read any Column Name I Pass.

Thanks in Advance

@Daniyal_Tahir
If you’re using a regular DataTable, then you don’t need to use Fetch(…) or ExpansionFieldOption. Those are mainly used with data from Data Service or other sources where relationships need to be expanded.

In your case, since your DataTable contains columns like "Country", "D.O.B", and "Full Name", you only need to pass the DataTable variable itself in the “List Source”. Then, in the Column field, enter the exact column name from which you want to display values, such as “Full Name”.

Hi @Daniyal_Tahir

Try to Use this in the List Source:

yourDataTable.AsEnumerable().Select(Function(r) r(ColumnName).ToString).Distinct().ToArray()

Ensure ColumnName is set dynamically before using it.

Happy Automation.

@Daniyal_Tahir

just give datatablevarianlename.ToListSource and then give the column name

example

cheers

I have created an Entity where I am storing my DataTable values.

Entity consist of the Column Name Full Name, Now I need the rows available in FullName to show up in Drop Down List.

When passing the Entity Name is giving Error

Thanks for the Reply…


Its giving this Error

Hi, Thanks for the Reply…


facing this Error

@Daniyal_Tahir
You can’t just use the name of the entity (like My_DataTable) directly in the “List Source” field in UiPath Apps. Instead, you need to create a variable of type ListSource (i.e. Fetch) that will fetch data from the entity.

Click on “+ Create variable” next to the List Source field, give your variable a name (for example, myDataListor something), and in the expression editor write:

Fetch(of MyDataTable)(Nothing)

Once saved, select this variable as your list source. Then in the “Column” field, type the exact name of the field from the entity – for example, FullName – to display values from that column in the dropdown.

@pikorpa Thank you so much, it worked.

2 Likes

@Daniyal_Tahir

If its a datatable coming from process it would work..but for you looks like its an entity and not a data source so the other way would work

Happy Automation

Cheers

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