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 / Powerfx converting cus...
Power Automate
Suggested Answer

Powerfx converting custom objects to datatable

(2) ShareShare
ReportReport
Posted on by 18
Hello,
 
I'm using Power fx in PAD but working with data tables seems so much harder than the old syntax in PAD.
I have a some text that is actually JSON, then I'm using a convert JSON to custom object to convert it into an object I can work with. But even after reading the documentation on powerfx about untyped objects - I can't figure out how to insert the values from the custom object (TmpEventList) into data table (EventsTable) so it only has the actual value in the data table rows & columns and not some custom object representation. 
 
 
This is the JSON text variable TmpEventsOut:
[
    {
        "Title": "Test Europe 2025",
        "Position": 0
    },
    {
        "Title": "Test Europe 2024",
        "Position": 1
    },
    {
        "Title": "Test Spring 2025",
        "Position": 2
    }
]
 
 
The events table definition is this where Position (from JSON) would be mapped to Position, and Title (from JSON) would be mapped to Event:
 
All the for each loop is doing is iterating through the List and trying to insert each item as row in the data table, but I can't get it to work ☹️
 
I put in an intermediate step to create a row record in variable NewVar which looks like this:
 
={Position:Value(CurrentItem.Position), Event: Text(CurrentItem.Title)}
 
 
But when I try and insert that into the datatable EventsTable it gives me the following error:
Correlation Id: 21efddb0-f7d1-4e1c-a584-2578cb219764
Microsoft.PowerPlatform.PowerAutomate.Desktop.Actions.SDK.ActionException: The amount of values provided to be added (1) don't match the columns of the data table (2).
   at Microsoft.Flow.RPA.Desktop.Modules.Variables.Actions.AddRowToDataTable.Execute(ActionContext context)
   at Microsoft.Flow.RPA.Desktop.Robin.Engine.Execution.ActionRunner.Run(IActionStatement statement, Dictionary`2 inputArguments, Dictionary`2 outputArguments)
 
Don't understand why is not working, also is there an easier way to insert values in a datatable based on column position instead of defining every column with a name and value before inserting into the table?
I have the same question (0)
  • Suggested answer
    Deenuji_Loganathan_ Profile Picture
    6,250 Super User 2025 Season 2 on at
    Hi,
     

    Power Fx for Power Automate Desktop is still in preview and has many limitations. If you create your bot with the Power Fx enabled feature, there is a high risk if Microsoft makes changes during the General Availability (GA) release. Therefore, we do not recommend using Power Fx for any flows at this time.

     

    Please let me know your thoughts.

     

    Thanks,

    Deenu

     
     

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 507 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 267 Moderator

#3
abm abm Profile Picture

abm abm 232 Most Valuable Professional

Last 30 days Overall leaderboard