cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Helper II
Helper II

Power Apps->Power Automate and parse json

I have a Power Apps sending data to Power Apps...this is the "body" from Monitor...

sasrsc_0-1601384459148.png

I'm sending this to Power Automate...where SelectedCollection is the collection and I'm only sending the first record.
FlightOpsComplianceTriggerApproval.Run(JSON(First(SelectedCollection)));

When I look at this in Power Automate I see...

{
  "ParseJSON_Content""{\"AcceptJetRide\":\"Y\",\"Company\":\"CONSULTANT\",\"Email\":\"jamesastorer@comcast.net\",\"GovBoard\":\"N\",\"GovOfficial\":\"N\",\"GovOwned\":\"N\",\"ID\":302,\"Nationality\":\"US\",\"PaxID\":\"118\",\"PaxName\":\"Storer, James\",\"Routing\":\"RDU-KGGG-RDU\",\"Start\":\"2020-10-13\",\"TripId\":\"38\",\"TripPurpose\":null}"
}
 
When I Parse this using the Action Item Parse Json I paste in the json above (how Power Automate sees it) and it says invalid JSON, so I paste in how Power Apps sends it using the body example and it accepts it if I add a leading and trailing {} but the output is a string. I'm not sure if having a value of null is throwing this off.

I've been playing with this for hours now and it's infuriating... I have validated the schema in JSON Lint so I know it's valid.
 
 
 

It just doesn't like the JSON. 

When I paste the string that Power Automate sees in the trigger the extra \ and " throw it off.

Any tips/tricks to better solve this would be appreciated.

 

 

My current schema is ...
 

 

{
  "type""object",
  "properties": {
    "body": {
      "type""object",
      "properties": {
        "ParseJSON_Content": {
          "type""object",
          "properties": {
            "AcceptJetRide": {
              "type""string"
            },
            "Company": {
              "type""string"
            },
            "Email": {
              "type""string"
            },
            "GovBoard": {
              "type""string"
            },
            "GovOfficial": {
              "type""string"
            },
            "GovOwned": {
              "type""string"
            },
            "ID": {
              "type""integer"
            },
            "Nationality": {
              "type""string"
            },
            "PaxID": {
              "type""integer"
            },
            "PaxName": {
              "type""string"
            },
            "Routing": {
              "type""string"
            },
            "Start": {
              "type""string"
            },
            "TripId": {
              "type""integer"
            },
            "TripPurpose": {
              "type""string"
            }
          }
        }
      }
    }
  }
}
 
1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Resident Rockstar
Resident Rockstar

Re: Power Apps->Power Automate and parse json

@sasrsc 

 

Hey Mate,

 

You JSON does not complain, although I had to use Parse JSON twice.

 

CFernandes_0-1601427901015.png

 

The First schema was generated using 

 

{
  "ParseJSON_Content": "{\"AcceptJetRide\":\"Y\",\"Company\":\"CONSULTANT\",\"Email\":\"jamesastorer@comcast.net\",\"GovBoard\":\"N\",\"GovOfficial\":\"N\",\"GovOwned\":\"N\",\"ID\":302,\"Nationality\":\"US\",\"PaxID\":\"118\",\"PaxName\":\"Storer, James\",\"Routing\":\"RDU-KGGG-RDU\",\"Start\":\"2020-10-13\",\"TripId\":\"38\",\"TripPurpose\":null}"
}

 

The Second one was created using the Output of the First Parse JSON action:

 

{
    "type": "object",
    "properties": {
        "AcceptJetRide": {
            "type": "string"
        },
        "Company": {
            "type": "string"
        },
        "Email": {
            "type": "string"
        },
        "GovBoard": {
            "type": "string"
        },
        "GovOfficial": {
            "type": "string"
        },
        "GovOwned": {
            "type": "string"
        },
        "ID": {
            "type": "integer"
        },
        "Nationality": {
            "type": "string"
        },
        "PaxID": {
            "type": "string"
        },
        "PaxName": {
            "type": "string"
        },
        "Routing": {
            "type": "string"
        },
        "Start": {
            "type": "string"
        },
        "TripId": {
            "type": "string"
        },
        "TripPurpose": {}
    }
}

 

Final Output:

 

CFernandes_1-1601428071212.png

 

If this reply has answered your question or solved your issue, please mark this question as answered. Answered questions helps users in the future who may have the same issue or question quickly find a resolution via search. If you liked my response, please consider giving it a thumbs up. THANKS!

 

View solution in original post

1 REPLY 1
Highlighted
Resident Rockstar
Resident Rockstar

Re: Power Apps->Power Automate and parse json

@sasrsc 

 

Hey Mate,

 

You JSON does not complain, although I had to use Parse JSON twice.

 

CFernandes_0-1601427901015.png

 

The First schema was generated using 

 

{
  "ParseJSON_Content": "{\"AcceptJetRide\":\"Y\",\"Company\":\"CONSULTANT\",\"Email\":\"jamesastorer@comcast.net\",\"GovBoard\":\"N\",\"GovOfficial\":\"N\",\"GovOwned\":\"N\",\"ID\":302,\"Nationality\":\"US\",\"PaxID\":\"118\",\"PaxName\":\"Storer, James\",\"Routing\":\"RDU-KGGG-RDU\",\"Start\":\"2020-10-13\",\"TripId\":\"38\",\"TripPurpose\":null}"
}

 

The Second one was created using the Output of the First Parse JSON action:

 

{
    "type": "object",
    "properties": {
        "AcceptJetRide": {
            "type": "string"
        },
        "Company": {
            "type": "string"
        },
        "Email": {
            "type": "string"
        },
        "GovBoard": {
            "type": "string"
        },
        "GovOfficial": {
            "type": "string"
        },
        "GovOwned": {
            "type": "string"
        },
        "ID": {
            "type": "integer"
        },
        "Nationality": {
            "type": "string"
        },
        "PaxID": {
            "type": "string"
        },
        "PaxName": {
            "type": "string"
        },
        "Routing": {
            "type": "string"
        },
        "Start": {
            "type": "string"
        },
        "TripId": {
            "type": "string"
        },
        "TripPurpose": {}
    }
}

 

Final Output:

 

CFernandes_1-1601428071212.png

 

If this reply has answered your question or solved your issue, please mark this question as answered. Answered questions helps users in the future who may have the same issue or question quickly find a resolution via search. If you liked my response, please consider giving it a thumbs up. THANKS!

 

View solution in original post

Helpful resources

Announcements
Community Conference

Power Platform Community Conference

Check out the on demand sessions that are available now!

Power Platform ISV Studio

Power Platform ISV Studio

ISV Studio is designed to become the go-to Power Platform destination for ISV’s to monitor & manage published applications.

Upcoming Events

Experience what’s next for Power Automate

See the latest Power Automate innovations, updates, and demos from the Microsoft Business Applications Launch Event.

Top Solution Authors
Users online (6,190)