3

Using Sitecore 9.0 and DEF 2.0.1, imagine I am processing this json:

{

  "name": "XXX",
  "id" : "1234,
  "childobject": [
    {
      "id": "1",
      "name": "YYY",
      "type": "AAA"

    },
    {
      "id" : "2"
      "name": "FFF",
      "type": "ASSSAA"
    }
  ]
}

I am processing child objects via a "Copy Object from Context to New Location Pipeline Step" and then iterating over them..

I then Resolve the Sitecore item for the child object - in this case to a seperate Sitecore folder. In my mapping for child object, I need to set the value of a Sitecore field to the id of the parent object i.e. ParentId to "XXX" but at this stage I don't have access to the the id of the parent object as the "Copy Object..." pipeline step is using the json only for child objects. How can I set the value of this parent id field inside my child object?

1

Add Apply Mapping pipeline step to take parent id and set to child.

Example:

enter image description here

Configuration for Apply Mapping

enter image description here

Configuration for Apply Mapping for Parent Id

enter image description here

In the apply mapping for parent Id you can accessing to the parent object selection Pipeline Context Parent Source and assign corresponded Mapping Set configuration.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.