web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / Unable to convert obje...
Power Automate
Unanswered

Unable to convert object to array using power automate

(0) ShareShare
ReportReport
Posted on by 17

Hi Community

 

I have a flow through which i want to extract the values of a datatable in powerapps in an excel file.

 

But in my flow i am getting following error "The 'from' property value in the 'table' action inputs is of type 'Object'. The value must be of type 'Array'."

 

Can someone please help.

 

Following are the screenshpts

vikz4_0-1678460829804.png

 

vikz4_1-1678460850799.png

 

Inside Create CSV Table i am using this

vikz4_2-1678460912463.png

 

Any help would be greatly appreciated!

 

 

 

Categories:
I have the same question (0)
  • grantjenkins Profile Picture
    11,063 Moderator on at

    It's because your Compose contains a single object that looks like it might contain objects within it. However, Create CSV table expects an array of items - not an object. Do you have multiple users in your JSON (Compose)?

  • grantjenkins Profile Picture
    11,063 Moderator on at

    Hopefully this will get what you're looking for. I used some XPath expressions to convert the data to an array of objects. I'm assuming you want to add only certain fields to your CSV table.

     

    See full flow below. I'll go into each of the actions.

    grantjenkins_0-1678628155775.png

     

    Compose contains some sample data, in a similar structure to yours. I want to extract out the Name and Age into my CSV table. You would like want the DisplayName, Email, etc. from your data.

    grantjenkins_1-1678628229122.png

     

    Create CSV table uses the following expressions to extract out the data (Name, Age).

    //From
    xpath(xml(json(concat('{"root": ', outputs('Compose'), '}'))), '//root/*')
    
    //Name
    xpath(item(), 'string(/*/Name/text())')
    
    //Age
    xpath(item(), 'number(/*/Age/text())')
    
    //You would use something like the following for your data
    xpath(item(), 'string(/*/DisplayName/text())')
    xpath(item(), 'string(/*/Email/text())')
    xpath(item(), 'string(/*/Department/text())')
    xpath(item(), 'string(/*/JobTitle/text())')

     

    After running my flow, I would have the following CSV table.

    grantjenkins_2-1678628513084.png


    ----------------------------------------------------------------------
    If I've answered your question, please mark the post as Solved.
    If you like my response, please consider giving it a Thumbs Up.

  • vikz4 Profile Picture
    17 on at

    Can you please elaborate it in a step by step manner...im fairly new to power automate and power apps...

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 538 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 405 Moderator

#3
abm abm Profile Picture

abm abm 252 Most Valuable Professional

Last 30 days Overall leaderboard