3

I want to import a bunch of films, which all have certain genres. The genres have already been set up as Categories in Craft, so each genre already has an Element ID (if that's relevant).

Here's a glance at my JSON feed...

{
    'title': "Epic Film",
    'genre': "action adventure"
},
{
    'title': "Sappy Love Story",
    'genre': "romance"
}

Unfortunately, that doesn't seem to work. I keep getting the following error:

Genre cannot be blank.

How do I format data in a JSON field, to ensure that it's treated as a relationship between two elements?

4

Have you set the type of data you're providing for the category field? Each element field allows you to state what attribute the data you're trying to import. Title, ID or slug, which are shown in a small dropdown field on the feed mapping page.

enter image description here

Can you check this?

  • That was it! Can't believe I overlooked that dropdown. Thanks! :) – Lindsey D May 15 '17 at 22:53

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.