cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
CapstoneAdmin
Advocate II
Advocate II

Gallery showing [object Object] for a text SharePoint column

I've got a SharePoint list. Every custom column is a text column. OnStart of the app I filter and ClearCollect the data source into a collection. I then display this collection in a gallery. The first 9 items display perfectly, however the 10th item and beyond shows "[object Object]" for the text field. The label is set to ThisItem.ColumnName. I have verified the column in SharePoint is of type Single Line of Text. To troubleshoot, I inserted a data table and set the items to the same collection. The column displays perfectly (see screenshot).

 

How can I get the column to display correctly? I can change it to a LookUp back to the datasource, but it increases the load time. Any help is appreciated!

1 ACCEPTED SOLUTION

Accepted Solutions
v-albai-msft
Community Support
Community Support

Hi @CapstoneAdmin ,

Could you provide your formula about how to create the collection? I am assuming you use formula like below, if I misunderstand, please correct me.

 

ClearCollect(collectiontest,Filter(SpList,<condition>))​

 

Is there any difference between the first 9 items and the 10th items(firstly compare the information in “ColumnName”)? Such as, is there any characters in the 10th items? [object object] would typically indicate that the data you are trying to display is complex rather than a simple text field. Not sure which format of data are kept in your ColumnName column.  As a result, try to set your label to below formula then check if issue still exists:

 

 

PlainText(ThisItem.ColumnName)

 

 

If PlainText() still do not work, you may try below method:

  1. OnStart of the app, use below formula to filter and ClearCollect the data source into a collection. Besides, outside Filter(),  use AddColumns() to adds a new column("NewtestColumn") to this new collection, defines his value same as the “ColumnName” column:

 

ClearCollect(collectiontest,AddColumns(Filter(SpList,<condition>)," NewtestColumn ",ColumnName))​

 

  • For the issued label, set its to:

 

ThisItems.NewtestColumn​

 

  • Check the result this time.

Best Regards,

Allen

View solution in original post

2 REPLIES 2
v-albai-msft
Community Support
Community Support

Hi @CapstoneAdmin ,

Could you provide your formula about how to create the collection? I am assuming you use formula like below, if I misunderstand, please correct me.

 

ClearCollect(collectiontest,Filter(SpList,<condition>))​

 

Is there any difference between the first 9 items and the 10th items(firstly compare the information in “ColumnName”)? Such as, is there any characters in the 10th items? [object object] would typically indicate that the data you are trying to display is complex rather than a simple text field. Not sure which format of data are kept in your ColumnName column.  As a result, try to set your label to below formula then check if issue still exists:

 

 

PlainText(ThisItem.ColumnName)

 

 

If PlainText() still do not work, you may try below method:

  1. OnStart of the app, use below formula to filter and ClearCollect the data source into a collection. Besides, outside Filter(),  use AddColumns() to adds a new column("NewtestColumn") to this new collection, defines his value same as the “ColumnName” column:

 

ClearCollect(collectiontest,AddColumns(Filter(SpList,<condition>)," NewtestColumn ",ColumnName))​

 

  • For the issued label, set its to:

 

ThisItems.NewtestColumn​

 

  • Check the result this time.

Best Regards,

Allen

View solution in original post

v-albai-msft
Community Support
Community Support

Hi @CapstoneAdmin ,

How are things going? Have you solved your issue?

If my solution is helpful to you, please mark my answer. This will benefit other community members who stuck with the same question.

Best regards,

Allen

Helpful resources

Announcements
UG GA Amplification 768x460.png

Launching new user group features

Learn how to create your own user groups today!

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

M365 768x460.jpg

Microsoft 365 Collaboration Conference | December 7–9, 2021

Join us, in-person, December 7–9 in Las Vegas, for the largest gathering of the Microsoft community in the world.

Top Solution Authors
Top Kudoed Authors
Users online (3,261)