cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
IronFelix
Helper I
Helper I

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
v-litu-msft
Community Support
Community Support

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
Helper I
Helper I

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

Hi @IronFelix 

 

Can you share the JSON response (sample data) 

 

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
  }
}

v-litu-msft
Community Support
Community Support

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

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

Helpful resources

Announcements
MPA User Group

Welcome to the User Group Public Preview

Check out new user group experience and if you are a leader please create your group

MBAS on Demand

Microsoft Business Applications Summit sessions

On-demand access to all the great content presented by the product teams and community members! #MSBizAppsSummit #CommunityRocks

MBAS Attendee Badge

Claim Your Badge & Digital Swag!

Check out how to claim yours today!

secondImage

Are Your Ready?

Test your skills now with the Cloud Skill Challenge.

Top Solution Authors
Users online (67,885)