cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
IronFelix
Level: Powered On

Parse Json Error with nested Json

Hi everyone,

is it possible for some help to a newbie?

We are calling in a flow an operation from a custom connector that consumes an endpoint (SelectAllVessels)

It has a schema from the api-docs of the endpoint etc. The schema has nested objects:

so for the vessel, it has an id (vessel id in the screenshot) ,other fields and some nested objects with multiple records (Vessel ids)

Our scope is to insert new records in a cds enity vessel based on an apply- to each loop for each id is coming and then continue with other insert in other entities. What should i select in the content in order to do not get the error:

InvalidTemplate. Unable to process template language expressions in action 'Parse_JSON' inputs at line '1' and column '2648': 'Required property 'content' expects a value but got null. Path ''.'.ParseJson.PNG

I have tried all the objects that the custom connector provides in the flow

Thanks in advance

 

1 ACCEPTED SOLUTION

Accepted Solutions
Community Support Team
Community Support Team

Re: Parse Json Error with nested Json

Hi @IronFelix,

 

Please try the following method to get the ID, put these data into the Parse JSON Content, then use the Compose to get the vessels id:Annotation 2019-10-15 160823.png

 

Annotation 2019-10-15 160749.png

Best Regards,
Community Support Team _ Lin Tu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

5 REPLIES 5
IronFelix
Level: Powered On

Re: Parse Json Error with nested Json

some update, if in the Parse Json content i pass the upper hierachy object (ie vessel)

When i try to set variable to create the array with all id in order to start the loop (apply-to each) , i can see only the nested objects Man Sad

 

Objects.PNG

Dual Super User
Dual Super User

Re: Parse Json Error with nested Json

Hi @IronFelix 

 

Can you share the JSON response (sample data) 

 

IronFelix
Level: Powered On

Re: Parse Json Error with nested Json

HI @RezaDorrani sorry for coming back so late, i was trying to find a solution, whatever i have tried is getting a null value 😞 

The folllowing outcome is from another endpoint (vessel) but the structure is totally the same since they are using the same services behind (as you can see it's coming from a hal for that reason is starting with _embedded). Anyway i have tried all  item()? but i am not getting anything.

If you can help is much appreciated

{
  "_embedded": {
    "vessels": [
      {
        "id": "78acf69c-246e-431f-b802-66b777b2645b",
        "ids": {
          "cfr": "GR003191989",
          "uvi": "8914120",
          "ircs": "MFTX2",
          "extMark": "FWED283",
          "regNbr": "C18304"
        },
        "name": "ALEX VAN PAPAS",
        "typeCode": "TU",
        "registrationCountry": "GBR",
        "registrationEvents": [
          {
            "location": {
              "type": "PORT",
              "country": "GBR",
              "id": "FD"
            }
          }
        ],
        "constructionEvent": {
          "occurrence": "2016-01-01T00:00:00Z"
        },
        "vesselEngines": [
          {
            "roleCode": "MAIN",
            "powerMeasurementUnit": "KWT",
            "powerMeasurement": "1470"
          },
          {
            "roleCode": "AUX",
            "powerMeasurementUnit": "KWT",
            "powerMeasurement": "400"
          }
        ],
        "vesselDimensions": [
          {
            "typeCode": "LOA",
            "measurementUnit": "MTR",
            "measurement": 40.25
          },
          {
            "typeCode": "LBP",
            "measurementUnit": "MTR",
            "measurement": 35.86
          },
          {
            "typeCode": "GT",
            "measurementUnit": "TNE",
            "measurement": 474
          }
        ],
        "vesselTechnicalCharacteristics": [
          {
            "typeCode": "HULL",
            "valueCode": "2",
            "valueType": "VESSEL_HULL_TYPE"
          }
        ],
        "vesselStorageCharacteristics": [],
        "vesselAdminCharacteristics": [
          {
            "typeCode": "LICENCE",
            "valueCode": "Y",
            "valueType": "BOOLEAN_TYPE"
          },
          {
            "typeCode": "SEG",
            "valueCode": "MFL",
            "valueType": "VESSEL_SEGMENT"
          },
          {
            "typeCode": "EIS",
            "valueDateTime": "2004-10-19T00:00:00Z"
          },
          {
            "typeCode": "EXPORT",
            "valueType": "VESSEL_EXPORT_TYPE"
          },
          {
            "typeCode": "AID",
            "valueCode": "PA",
            "valueType": "VESSEL_PUBLIC_AID_TYPE"
          }
        ],
        "namePLN": "ALEX VAN PAPAS (FWED283)",
        "_links": {
          "self": {
            "href": "http://alex-vessel-service.alex.psp.cluster.local/v1/vessels/78acf69c-246e-431f-b802-66b777b2645b"
          },
          "vessels": {
            "href": "http://alex-vessel-service.alex.psp.cluster.local/v1/vessels/78acf69c-246e-431f-b802-66b777b2645b"
          }
        }
      }
    ]
  },
  "_links": {
    "first": {
      "href": "http://alex-vessel-service.alex.psp.cluster.local/v1/vessels?page=0&size=1"
    },
    "self": {
      "href": "http://alex-vessel-service.alex.psp.cluster.local/v1/vessels{?filter}",
      "templated": true
    },
    "next": {
      "href": "http://alex-vessel-service.alex.psp.cluster.local/v1/vessels?page=1&size=1"
    },
    "last": {
      "href": "http://alex-vessel-service.alex.psp.cluster.local/v1/vessels?page=5628&size=1"
    }
  },
  "page": {
    "size": 1,
    "totalElements": 5629,
    "totalPages": 5629,
    "number": 0
  }
}

Community Support Team
Community Support Team

Re: Parse Json Error with nested Json

Hi @IronFelix,

 

Please try the following method to get the ID, put these data into the Parse JSON Content, then use the Compose to get the vessels id:Annotation 2019-10-15 160823.png

 

Annotation 2019-10-15 160749.png

Best Regards,
Community Support Team _ Lin Tu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

Highlighted
IronFelix
Level: Powered On

Re: Parse Json Error with nested Json

thanks @v-litu-msft , it worked. Thanks very much everybody

Helpful resources

Announcements
firstImage

Better Together Contest Finalists Announced!

Congrats to the finalists of our ‘Better Together’-themed T-shirt design contest! Click for the top entries.

firstImage

Incoming: New and improved badges!

Look out for new contribution recognition badges coming SOON!

firstImage

New & Improved Power Automate Community Cookbook

We've updated and improved the layout and uploading format of the Power Automate Cookbook!

thirdimage

Power Automate Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

sixthImage

Community Summit North America

The top training and networking event across the globe for Microsoft Business Applications

Top Solution Authors
Top Kudoed Authors
Users online (3,816)