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

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / Object Creation with i...
Power Automate
Unanswered

Object Creation with in PAD

(0) ShareShare
ReportReport
Posted on by 152

Hi, I have 5 rows and each row has 5 columns with in for loop. 

 

I wanted to build a custom object or array with in PAD and pass this to Power Automate from output variable to parse the data. 

 

Could you please help us to find a solution, I tried to create the object but seems it is not working. 

 

vamsi_varanasi_0-1635524579920.png

 

  • fraenK Profile Picture
    2,125 on at

    Custom object has a notation similar to JSON so you can't add a "," after "}", it has to be added before the bracket.

    https://docs.microsoft.com/en-us/power-automate/desktop-flows/variable-data-types#advanced-data-types

  • vamsi_varanasi Profile Picture
    152 on at

    Thanks for your response @fraenK .

     

    But I am not clear what you are explaining. could you please help me to create a object or array in PAD so that I will send this to Power Automate for parsing ?

     

     

  • Agnius Bartninkas Profile Picture
    Most Valuable Professional on at

    @vamsi_varanasi , I've already replied to this under https://powerusers.microsoft.com/t5/Power-Automate-Desktop/Data-Table-to-JSON-object-in-PAD/m-p/1331580#M8067

     

    You can simply push the entire table as a property into a custom object and then use the 'Convert custom object to JSON' action to convert it to JSON than can then be passed to Power Automate.

     

    Power Automate actually does not even have a variable of type DataTable. Whenever you read a table in Power Automate (whether from a SQL database or an Excel file, etc.), you will end up with a similar JSON file with a list of objects, where each row of the table is an object. So, doing it like what I suggested under the other topic is exactly what Power Automate does in general.

  • Agnius Bartninkas Profile Picture
    Most Valuable Professional on at

    @vamsi_varanasi, just re-posting what was posted under the other topic, so it is easy to find for others who might be looking for this. Please mark this as the accepted solution, if you believe this solves your problem.

     

    It is quite straight forward. When you have a table in a variable (e.g. %Table%), you can simply push it into a custom object and then convert it to Json.

     

    Here's a quick sample. I created a simple Excel file with the following table:

    KeyValue
    One1
    Two2
    Three3

     

    I then read the file, extracting data so that the first row is a header row. Here's the result from PAD:

    AgniusBartninka_0-1635607010698.png

     

    I then used the following three actions (you can copy and paste this directly to PAD):

     

    SET NewVar TO {{ }}
    SET NewVar['Table'] TO Table
    Variables.ConvertCustomObjectToJson CustomObject: NewVar Json=> CustomObjectAsJson

     

    Looks like this in PAD:

    AgniusBartninka_1-1635607010711.png

     

     

    What it does is as follows:

    1. Create a new empty custom object named %NewVar% (you don't really need to create a new object if you already have one, though)
    2. Add a property named 'Table' to the custom object with %Table% as its value*
    3. Convert the custom object to Json

    Note: If you already have a property with the same name in the object, it will be overwritten. If you do not, it will be added as a new property.

     

    The custom object (%NewVar%) will look like this:

    AgniusBartninka_2-1635607010523.png

     

    The 'Table' property inside of it will look like this:

    AgniusBartninka_3-1635607010717.png

     

    And the Json data after conversion (%CustomObjectAsJson%) will look like this:

     

    {"Table":[{"Key":"One","Value":"1"},{"Key":"Two","Value":"2"},{"Key":"Three","Value":"3"}]}

     

    As you can see, it basically is converted into a list of objects, with each row being a list item, and each value being added with the column names as keys.

    This can then easily be parsed by Power Automate.

  • comsys Profile Picture
    73 on at

    fix later

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

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Leaderboard > Power Automate

#1
11manish Profile Picture

11manish 249 Super User 2026 Season 2

#2
Mohsin Ali Profile Picture

Mohsin Ali 202

#3
David_MA Profile Picture

David_MA 180 Super User 2026 Season 2

Last 30 days Overall leaderboard