1

According to the CraftCMS FeedMe 4 docs we should be able to import inner element field data when importing content via FeedMe.

I have a section we'll call Parent, which has two fields that need importing; ImportId (text field) and ChildEntry (Entry relationship). Child Entry has two fields, Title and Body.

I am able to map Parent->ImportId and ChildEntry->Title I am unable to map to ChildEntry->Body.

My JSON looks like this:


{
  "data": [
    {
      "title": "secrets",
      "import_id": "UUID-9-3/4",
      "child_title": "Harry Potter",
      "child_message": "Is in a dream",
    },
    ...
  ]
}

Is this expected functionality, or am I reading the documentation correctly?

3
  • What type of field is ChildEntry->Body? Could it be that this is not a text field (but a Matrix field for instance), and therefore FeedMe can not use it for import?
    – Paul
    Commented Apr 16, 2019 at 9:19
  • It's a rich text field. Commented Apr 18, 2019 at 12:54
  • This should work, I just did that recently. Would you share a bit more Information? Maybe a Screenshot of the current Setup? Commented Apr 26, 2020 at 11:11

1 Answer 1

2

You should nest the child's details like so:

{
    "data": [
        {
            "title": "secrets",
            "import_id": "UUID-9-3/4",
            "child": {
                "child_title": "Harry Potter",
                "child_message": "Is in a dream"
            }
        }
    ]
}

Then make sure you you choose data as your Primary Element when mapping your feed and check Create entries if they do not exist for the relational field.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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