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
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
v-albai-msft
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

v-albai-msft
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
PA User Group

Welcome to the User Group Public Preview

Check out new user group experience and if you are a leader please create your group

Power Apps Community Call

Monthly Power Apps Community Call

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

secondImage

Experience what’s next for Power Apps

See the latest Power Apps innovations, updates, and demos from the Microsoft Business Applications Launch Event.

Power Platform ISV STudio

Power Platform ISV Studio

ISV Studio is the go-to Power Platform destination for ISV’s to monitor & manage applications post-AppSource publish.

Top Solution Authors
Top Kudoed Authors
Users online (67,113)