cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
livingstonep
Level 8

powerapps datatable using Collection as datasource won't show lookup column correctly

We are building a PowerApps screen with a data table using a collection as the data source for the *Items* property.

In our **onVisible** event of the screen we create the collection like this:

 

    ClearCollect(
        collTrackedSales,
        Filter(
            eBayIT_Item_Management,
            TCode = "A02"
        )
    )

 

eBayIT_Item_Management is the actual SharePoint list, and this includes a lookup column to another list called *ItemCategories* ...

 

The problem is that the column in the data table just shows [object Object] in that column...

 

I have created another data table on the screen just using the SP List as the source and it works fine...

Here are the images showing the problem:Data table 1 using SP List as data source.PNG

in the above picture you can see there is no problem displaying the *categories* field (which is a lookup column in the list).

 

In the below picture you can see there is an issue when using a collection as the source of the 2nd datatable:

 

Data table 2 using collection as data source.PNG

 

So what can I do in order to show the actual values in that list instead of `object Object`?

 

1 ACCEPTED SOLUTION

Accepted Solutions
Community Support Team
Community Support Team

Re: powerapps datatable using Collection as datasource won't show lookup column correctly

Hi @livingstonep,

Could you please share a bit more about the Category (LookUp column) property within your collTrackedSales collection?

Based on the screenshot that you provided, I think the Category (LookUp column) value stored as a Table value rather than a Text value within your collTrackedSales collection.

Actually, the LookUp column value retrieved from a SP list is a Table value rather than a Text value.

I have made a test, the issue is confirmed on my side. The screenshot as below:4.JPG

 

5.JPG

If you want to display the LookUp column value from the collTrackedSales collection within the Data Table control directly, I afraid that there is no way to achieve your needs in PowerApps currently.

As an alternative solution, you could consider take a try to add a column in your collTrackedSales collection to store the LookUp column value (rather than LookUp column itself), then display it within your Data Table.

I have made a test on my side, please take a try with the following workaround:6.JPG

 

7.JPG

Set the OnVisible property of the first screen of my app to following:

 

ClearCollect(
RecordsCollection,
AddColumns('20181019_case9_Courses',"OutcomeValue",Outcome.Value)
)

On your side, you should type:

 

 

ClearCollect(
collTrackedSales,
AddColumns(Filter(eBayIT_Item_Management, TCode = "A02"),"CategoryValue", Category.Value)
)

Set the Items property of the Data Table control to following:

RecordsCollection

On your side, you should type:

collTrackedSales

then enable CategoryValue column in Fields part of right Pop-up panel.

 

Best regards,

Kris

 

 

Community Support Team _ Kris Dai
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
1 REPLY 1
Community Support Team
Community Support Team

Re: powerapps datatable using Collection as datasource won't show lookup column correctly

Hi @livingstonep,

Could you please share a bit more about the Category (LookUp column) property within your collTrackedSales collection?

Based on the screenshot that you provided, I think the Category (LookUp column) value stored as a Table value rather than a Text value within your collTrackedSales collection.

Actually, the LookUp column value retrieved from a SP list is a Table value rather than a Text value.

I have made a test, the issue is confirmed on my side. The screenshot as below:4.JPG

 

5.JPG

If you want to display the LookUp column value from the collTrackedSales collection within the Data Table control directly, I afraid that there is no way to achieve your needs in PowerApps currently.

As an alternative solution, you could consider take a try to add a column in your collTrackedSales collection to store the LookUp column value (rather than LookUp column itself), then display it within your Data Table.

I have made a test on my side, please take a try with the following workaround:6.JPG

 

7.JPG

Set the OnVisible property of the first screen of my app to following:

 

ClearCollect(
RecordsCollection,
AddColumns('20181019_case9_Courses',"OutcomeValue",Outcome.Value)
)

On your side, you should type:

 

 

ClearCollect(
collTrackedSales,
AddColumns(Filter(eBayIT_Item_Management, TCode = "A02"),"CategoryValue", Category.Value)
)

Set the Items property of the Data Table control to following:

RecordsCollection

On your side, you should type:

collTrackedSales

then enable CategoryValue column in Fields part of right Pop-up panel.

 

Best regards,

Kris

 

 

Community Support Team _ Kris Dai
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.