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 Apps / Transforming JSON insi...
Power Apps
Unanswered

Transforming JSON inside Power Apps

(0) ShareShare
ReportReport
Posted on by 28

Hi all, fairly new to Power Apps. I am building an app where users select some items in a gallery which displays Sharepoint search results, to then export them to csv through a power automate flow.

When using the JSON() function in Power Apps to connect with the export flow, I get the "JSON function cannot serialize tables / objects with a nested property called 'Value' of type 'UntypedObject'." error.

The suggested fix in most posts online is using JSONFormat.IgnoreUnsupportedTypes, but results in an empty JSON being sent to Power Automate.

 

Structure of data returned by Sharepoint search API is:

 

 

 

 [
 {
 "IndividualSearchResult": [
 {
 "Key": "SomeKeyName", //for example "Title"
 "Value": "KeyValue", //actual title of the search result item
 "ValueType": "Edm.Int64"
 },
 {
 "Key": "SomeKeyName",
 "Value": "KeyValue",
 "ValueType": "Edm.Double"
 },
etc.

 

 

 

 

Is there a way to manually build the JSON to be sent to the flow, or another way to make the JSON function work?

I was thinking to loop through the keys and build a valid JSON inside a variable but there don't seem to be any comprehension options or methods to create it.

 

All help is appreciated, thanks!

 

Categories:
I have the same question (0)
  • Verified answer
    TheRobRush Profile Picture
    11,128 Moderator on at

    In my experience, when that error is encountered with json, you need to to specify the data type when breaking it down on powerapps side

    TheRobRush_0-1711396835801.png

    In example here you can see I had to specify the record (json example has multiple rows of data) then reference column i was looking for and surround ALL that in a Text() Value() DateTimeValue() etc.

    and here is an example of what force creating a structure looks like

    TheRobRush_1-1711396956910.png

    This is WHAT i sent in via flow to ensure its set up how I want it

     

    checklistJSON = "["&Concat(
     ForAll(checklistInProgress As dataSource, 
     "{
     ""Title"":"""&dataSource.Title&""",
     ""refID"":"""&dataSource.ID&""",
     ""inspectionVenue"":"""&dataSource.inspectionVenue&""",
     ""inspectionDescription"":"""&dataSource.inspectionDescription&""",
     ""lastInspectionDate"":"""&If(!IsBlank(dataSource.lastInspectionDate),dataSource.lastInspectionDate,currentTime)&""",
     ""inspectionNotes"":"""&If(!IsBlank(dataSource.inspectionNotes),dataSource.inspectionNotes,"none")&""",
     ""inspectionPosition"":"&dataSource.inspectionPosition&",
     ""inspectionComplete"":"&true&",
     ""inspectionResult"":"""&If(!IsBlank(dataSource.inspectionResult),dataSource.inspectionResult,"pass")&""",
     ""inspectedBy"":"""&If(!IsBlank(dataSource.inspectedBy), dataSource.inspectedBy, "unknown")&""",
     ""nestedTable"": ["&
     Concat(
    Filter( 
    Ungroup(
    ForAll(
     Split(dataSource.nestedTable, "//") As nestedRecords,
     If(Last(Split(nestedRecords.Value, ",")).Value="fail", "{""Value"":"""&First(Split(nestedRecords.Value, ",")).Value&"""}",Blank())),"Value"), !IsBlank(Value)),Value,", ")&
     "]
     }"),Value, ", ")&"]"; 

     


    where checklistInProgress is a local collection variable based on record I am working on

  • FernandoMT Profile Picture
    28 on at

    Thanks! This is certainly a solution although I would prefer not to do it fully manually if possible...

  • FernandoMT Profile Picture
    28 on at

    For anyone interested, this was the final structure I settled for, which sends a string to power automate, the conversion to a JSON object can be done in the flow side

    Set(_jsonSend, "["&Concat(
     ForAll(colSelectDoc As dataSource, 
     "{""Title"":"""&LookUp(Table(dataSource.Value.Cells),ThisRecord.Value.Key = "Title").Value.Value&""",
    ""HitHighlightedSummary"":"""&LookUp(Table(dataSource.Value.Cells),ThisRecord.Value.Key = "HitHighlightedSummary").Value.Value&""",
    ""Path"":"""&LookUp(Table(dataSource.Value.Cells),ThisRecord.Value.Key = "Path").Value.Value&"""
    }"),Value, ", ")&"]");
    
    ColToExcel.Run(_jsonSend)

     

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 Apps

#1
WarrenBelz Profile Picture

WarrenBelz 796 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 327 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard