cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
priyankbhat
Level: Powered On

DataTable is showing [object Object] in column for data from sharepoint

Hi,

 

I have created small App that pulls data from sharepoint list.

 

Form has Datatable and Formviewer to display rows selected in data table. Connection between Data table and form viewer has no issue. In data table i am showing 2 columns that are "Single Line of Text" in sharepoint.

 

I am planning to include Modified person name in view to identify who last updated this record rather than clicking on each rows and viewing in formviewer. Issue is when i include column which is "Person or Group" in sharepoint I see value [object Object] appearing in my App created with Powerapps. I tried running through properties and advance properties and even tried searching solution on internet but i failed to find solution.

 

Please guide me on how to fix this issue.

 

Thanks

2 ACCEPTED SOLUTIONS

Accepted Solutions
Super User
Super User

Re: DataTable is showing [object Object] in column for data from sharepoint

Hi Priyank,

 

It does seem to be a bit temperamental - sometimes it renders CreatedBy, sometimes it renders Author - and then you get [object Object] values.  Pretty weird, not sure why it does this, I'm sure someone more knowledgable than me could explain 🙂

 

To work around it however, you can add a column when you create the collection and manually traverse the person column object to put the object property you're looking for into the added column.  This effectively 'flattens' the object down to the field you want.

You can then use the added column in your grid.

 

so;

ClearCollect(CollectStuff, AddColumns(SharePointList, "FlatAuthor", Author.DisplayName))

Bear in mind, this only exists in the collection so you can display it in the data table.

 

complexGrid2_1.PNG

 

Hope this helps,

 

RT 

View solution in original post

Highlighted
priyankbhat
Level: Powered On

Re: DataTable is showing [object Object] in column for data from sharepoint

Hi Russel,

 

Your suggestion looks promising let me try this.

 

Thanks

Priyank

View solution in original post

6 REPLIES 6
Super User
Super User

Re: DataTable is showing [object Object] in column for data from sharepoint

Hi priyankbhat,

 

I know it used to be the case that DataTables could not render complex (or nested) objects at all.

I do believe this was updated in a later release however and, for Modified By and Created By at least, it seems to render the DisplayName property without any manipulation;

 

complexGrid.PNG

 

Do you perhaps have some more details you can share to help reproduce the problem on this side?

 

Kind regards,

 

RT

priyankbhat
Level: Powered On

Re: DataTable is showing [object Object] in column for data from sharepoint

Hi RT,

 

Find below screen short of error that is appearing.

 

 

Capture.JPG

 

REDStatus is collection that has been created from existing sharepoint view. Below is code.

 

Refresh('Status Report');
ClearCollect(REDStatus, Filter('Status Report', RAG_x0020_Status.Value = "RED"))

Below screenshot is from original sharepoint list.

Capture2.JPG

 

Thanks

Priyank

 

Super User
Super User

Re: DataTable is showing [object Object] in column for data from sharepoint

Thanks Priyank,

 

 

 

It seems to work the same for me whether using the source direct or using a collection from the source.  Below is the collection;

 

complexGrid2.PNG

 

So, I'm a bit stumped to be honest. 

I do notice however that your column names in your collection are different from the source, but changing the display names on my side don't affect the outcome. 

 

Are you using the web studio or the desktop studio?

 

 

Kind regards,


Russel

priyankbhat
Level: Powered On

Re: DataTable is showing [object Object] in column for data from sharepoint

Hi Russel,

 

I am using web studio.

 

Here is steps i done before i identified issue.

1) Add DataTable to screen and gave datasource to existing sharepoint table.

2) I am able to select column. 

3) Next thing i did was created collection using script i shared earlier and filtered data.

4) Manually in advance property window replaced sharepoint view with collection.

5) I am still able to see data in collection. Even any new data getting added to collection is correctly displaying.

 

Now issues occures if i do below

1) Goto property window and select additional Fields.

2) Additional text field is correctly getting displayed

3) Issue appears when i select any fields which has choices or "People and Group" datatype.

 

Temporarily i identified workaround

1) Goto property window and select original sharepoint table.

2) Select new columns which are choices or "People and Group" data type

3) Fields start displaying correct data 

4) Go back again to advance property and manually replace sharepoint table with collection.

 

This is workaround. Is there way when i see data as [object Object] I can manually map/make configuration to resolve issue ?

 

Thanks

 

Priyank Bhat

Super User
Super User

Re: DataTable is showing [object Object] in column for data from sharepoint

Hi Priyank,

 

It does seem to be a bit temperamental - sometimes it renders CreatedBy, sometimes it renders Author - and then you get [object Object] values.  Pretty weird, not sure why it does this, I'm sure someone more knowledgable than me could explain 🙂

 

To work around it however, you can add a column when you create the collection and manually traverse the person column object to put the object property you're looking for into the added column.  This effectively 'flattens' the object down to the field you want.

You can then use the added column in your grid.

 

so;

ClearCollect(CollectStuff, AddColumns(SharePointList, "FlatAuthor", Author.DisplayName))

Bear in mind, this only exists in the collection so you can display it in the data table.

 

complexGrid2_1.PNG

 

Hope this helps,

 

RT 

View solution in original post

Highlighted
priyankbhat
Level: Powered On

Re: DataTable is showing [object Object] in column for data from sharepoint

Hi Russel,

 

Your suggestion looks promising let me try this.

 

Thanks

Priyank

View solution in original post

Helpful resources

Announcements
thirdimage

Power Automate Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

sixthImage

Power Platform World Tour

Find out where you can attend!

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

fifthimage

Microsoft Learn

Learn how to build the business apps that you need.

Top Kudoed Authors
Users Online
Currently online: 205 members 5,452 guests
Please welcome our newest community members: