cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
alinawaz10
New Member

Nested json schema output issue

Hi Community users,

 

I am creating a Flow which gets triggered with a HTTP response.

The payload I receive has nested objects. (Payload sample attached at bottom)

In flow I am only able to get the data of payload elements which are not nested.

 

alinawaz10_0-1652731154829.png

Plus, when I put the data element in the content field of a new parse Json action, it throws an error "Unable to process template language expressions in action 'DataBody' inputs at line '0' and column '0': 'Required property 'content' expects a value but got null. Path ''.'."


Somehow the elements which are nested are not getting fetched in the schema.

 

{
  "headers": {
    "Host": "xxxxxxxxxxxxxxxxxxxxxxxx",
    "Request-Context": "xxxxxxxxxxxxxxxxxxxxxxxxxxxx",
    "Request-Id": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
    "traceparent": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
    "Content-Length": "609915",
    "Content-Type": "application/json; charset=utf-8"
  },
  "body": {
    "subjectType": "Task",
    "changeType": "Completed",
    "subjectFrontEndUrl": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
    "timeStamp": "2022-05-16T10:15:50.3686009Z",
    "data": {
      "id": 16520,
      "title": "DSG Expenses Form - (MB):2022-05-16-10-51",
      "description": "DSG Expenses Form - Maximum number 5",
      "priority": "Ad Hoc Task",
      "groupId": 684,
      "groupTitle": "General Forms",
      "progress": 100,
      "isAdhoc": false,
      "createdByPerson": {
        "PersonId": 24059,
        "FirstName": "Mark",
        "FamilyName": "Burgess",
        "Email": "mark.burgess@testting.com"
      },
      "person": {
        "PersonId": 24059,
        "FirstName": "Mark",
        "FamilyName": "Burgess",
        "Email": "mark.burgess@testting.com"
      },
      "manager": {
        "PersonId": 24059,
        "FirstName": "Mark",
        "FamilyName": "Burgess",
        "Email": "mark.burgess@testting.com"
      },
      "startedByPersonId": {
        "PersonId": 24059,
        "FirstName": "Mark",
        "FamilyName": "Burgess",
        "Email": "mark.burgess@testting.com"
      },
      "modifiedByPerson": {
        "PersonId": 24059,
        "FirstName": "Mark",
        "FamilyName": "Burgess",
        "Email": "mark.burgess@testting.com"
      },
      "completedByPerson": {
        "PersonId": 24059,
        "FirstName": "Mark",
        "FamilyName": "Burgess",
        "Email": "mark.burgess@testting.com"
      },
      "formData": {
        "Location": {
          "lat": 55.378051,
          "long": -3.435973
        },
        "Fields": [
          {
            "Field": {
              "Id": 1,
              "Title": "Expense Date",
              "FieldTypeId": 4,
              "FieldType": "Date"
            },
            "Value": "2022-05-16T00:00:00Z",
            "Location": {
              "lat": 55.378051,
              "long": -3.435973
            }
          },
          {
            "Field": {
              "Id": 2,
              "Title": "Description",
              "FieldTypeId": 3,
              "FieldType": "Text"
            },
            "Value": "new expense",
            "Location": {
              "lat": 55.378051,
              "long": -3.435973
            }
          },
          {
            "Field": {
              "Id": 3,
              "Title": "Company Expense Type",
              "FieldTypeId": 8,
              "FieldType": "Select List - Single"
            },
            "Value": "Entertaining - DSG",
            "Location": {
              "lat": 55.378051,
              "long": -3.435973
            }
          },
          {
            "Field": {
              "Id": 4,
              "Title": "Full Amount (incl VAT)",
              "FieldTypeId": 2,
              "FieldType": "Number"
            },
            "Value": 1000,
            "Location": {
              "lat": 55.378051,
              "long": -3.435973
            }
          },
          {
            "Field": {
              "Id": 5,
              "Title": "Does this include VAT?",
              "FieldTypeId": 7,
              "FieldType": "Radio Button"
            },
            "Value": "Yes",
            "Location": {
              "lat": 55.378051,
              "long": -3.435973
            }
          },
          {
            "Field": {
              "Id": 6,
              "Title": "VAT amount",
              "FieldTypeId": 2,
              "FieldType": "Number"
            },
            "Value": 200,
            "Location": {
              "lat": 55.378051,
              "long": -3.435973
            }
          },
          {
            "Field": {
              "Id": 7,
              "Title": "How was this expense originally paid?",
              "FieldTypeId": 8,
              "FieldType": "Select List - Single"
            },
            "Value": "With my own personal card/my own cash",
            "Location": {
              "lat": 55.378051,
              "long": -3.435973
            }
          },
          {
            "Field": {
              "Id": 8,
              "Title": "Chargeable to client",
              "FieldTypeId": 1,
              "FieldType": "Yes/No"
            },
            "Value": false,
            "Location": null
          },
          {
            "Field": {
              "Id": 9,
              "Title": "Attach Receipt/Image",
              "FieldTypeId": 11,
              "FieldType": "Attachment"
            },
            "Value": {
              "type": "image/jpeg",
              "src": "",
              "name": "IMG_1693.jpg"
            },
            "Location": {
              "lat": 55.378051,
              "long": -3.435973
            }
          },
          {
            "Field": {
              "Id": 10,
              "Title": "Expense Date",
              "FieldTypeId": 4,
              "FieldType": "Date"
            },
            "Value": "2022-05-16T00:00:00Z",
            "Location": {
              "lat": 55.378051,
              "long": -3.435973
            }
          },
          {
            "Field": {
              "Id": 11,
              "Title": "Description",
              "FieldTypeId": 3,
              "FieldType": "Text"
            },
            "Value": null,
            "Location": null
          },
          {
            "Field": {
              "Id": 12,
              "Title": "Company Expense Type",
              "FieldTypeId": 8,
              "FieldType": "Select List - Single"
            },
            "Value": null,
            "Location": null
          },
          {
            "Field": {
              "Id": 13,
              "Title": "Full Amount (incl VAT)",
              "FieldTypeId": 2,
              "FieldType": "Number"
            },
            "Value": null,
            "Location": null
          },
          {
            "Field": {
              "Id": 14,
              "Title": "Does This Include VAT?",
              "FieldTypeId": 7,
              "FieldType": "Radio Button"
            },
            "Value": null,
            "Location": null
          },
          {
            "Field": {
              "Id": 15,
              "Title": "VAT amount",
              "FieldTypeId": 2,
              "FieldType": "Number"
            },
            "Value": null,
            "Location": null
          },
          {
            "Field": {
              "Id": 16,
              "Title": "How was this expense originally paid?",
              "FieldTypeId": 8,
              "FieldType": "Select List - Single"
            },
            "Value": null,
            "Location": null
          },
          {
            "Field": {
              "Id": 17,
              "Title": "Chargeable to client",
              "FieldTypeId": 1,
              "FieldType": "Yes/No"
            },
            "Value": false,
            "Location": null
          },
          {
            "Field": {
              "Id": 18,
              "Title": "Attach Receipt/Image",
              "FieldTypeId": 11,
              "FieldType": "Attachment"
            },
            "Value": null,
            "Location": null
          }
        ]
      },
      "completedOn": "2022-05-16T10:15:49.013",
      "dueDate": "2022-05-16T00:00:00",
      "lastModified": "2022-05-16T10:15:50.307",
      "createdOn": "2022-05-16T10:15:14.693",
      "form": {
        "id": 2542,
        "title": "DSG Expenses Form"
      },
      "notificationSettings": {
        "push": false,
        "sms": false,
        "email": false,
        "microsoftTeams": false,
        "inApp": false
      },
      "contentSettings": {
        "allowLikes": false,
        "allowComments": false,
        "allowImagesInComments": false,
        "allowDocuments": false
      },
      "isDeleted": false
    },
    "differences": [
      {
        "path": "progress",
        "oldValue": "",
        "newValue": "100"
      },
      {
        "path": "isAdhoc",
        "oldValue": "True",
        "newValue": "False"
      },
      {
        "path": "startedByPersonId.personId",
        "oldValue": "0",
        "newValue": "24059"
      },
      {
        "path": "startedByPersonId.firstName",
        "oldValue": "",
        "newValue": "Mark"
      },
      {
        "path": "startedByPersonId.familyName",
        "oldValue": "",
        "newValue": "Burgess"
      },
      {
        "path": "startedByPersonId.email",
        "oldValue": "",
        "newValue": "mark.burgess@testting.com"
      },
      {
        "path": "completedByPerson.personId",
        "oldValue": "0",
        "newValue": "24059"
      },
      {
        "path": "completedByPerson.firstName",
        "oldValue": "",
        "newValue": "Mark"
      },
      {
        "path": "completedByPerson.familyName",
        "oldValue": "",
        "newValue": "Burgess"
      },
      {
        "path": "completedByPerson.email",
        "oldValue": "",
        "newValue": "mark.burgess@testting.com"
      },
      {
        "path": "completedOn",
        "oldValue": "",
        "newValue": "5/16/2022 10:15:49 AM"
      },
      {
        "path": "lastModified",
        "oldValue": "5/16/2022 10:15:42 AM",
        "newValue": "5/16/2022 10:15:50 AM"
      }
    ]
  }
}
1 REPLY 1
jinivthakkar
Super User
Super User

@alinawaz10 I took all your json in compose and was able to fetch data as required, I fetched the ID 16250 using below expression

 

outputs('Compose')?['body']?['data']['Id']
 
jinivthakkar_0-1652816321191.png

 

 
On similar lines you can fetch any data from your json
 

--------------------------------------------------------------------------------

If this post helps answer your question, please click on “Accept as Solution” to help other members find it more quickly. If you thought this post was helpful, please give it a Thumbs Up.

Helpful resources

Announcements
Microsoft 365 Conference – December 6-8, 2022

Microsoft 365 Conference – December 6-8, 2022

Join us in Las Vegas to experience community, incredible learning opportunities, and connections that will help grow skills, know-how, and more.

Difinity Conference 2022

Difinity Conference 2022

Register today for two amazing days of learning, featuring intensive learning sessions across multiple tracks, led by engaging and dynamic experts.

European SharePoint Conference

European SharePoint Conference

The European SharePoint Conference returns live and in-person November 28-December 1 with 4 Microsoft Keynotes, 9 Tutorials, and 120 Sessions.

Users online (1,813)