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

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
Microsoft
Microsoft

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
Microsoft
Microsoft

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

Microsoft
Microsoft

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
secondImage

Experience what’s next for Power Apps

Join us for an in-depth look at the new Power Apps features and capabilities at the free Microsoft Business Applications Launch Event.

Power Apps Community Call

Power Apps Community Call: February

Did you miss the call? Check out the Power Apps Community Call here.

New Power Super Users

Congratulations!

We are excited to announce the Power Apps Super Users!

New Badges

New Solution Badges!

Check out our new profile badges recognizing authored solutions!

Top Solution Authors
Top Kudoed Authors
Users online (87,923)