<p>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.</p>

<p><a href="https://i.sstatic.net/yk63L.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/yk63L.png" alt="enter image description here"></a></p>

<p>Can you check this?</p>

CC BY-SA 3.0
2017-05-15T22:53:18.330Z
That was it! Can't believe I overlooked that dropdown. Thanks! :)
Lindsey D
CC BY-SA 3.0
2017-05-15T22:05:31.667Z
2017-05-15T22:05:31.667Z
crawf
<p>I want to import a bunch of <strong>films</strong>, which all have certain <strong>genres</strong>. The genres have already been set up as Categories in Craft, so each genre already has an Element ID (if that's relevant).</p>

<p>Here's a glance at my JSON feed...</p>

<pre class="lang-json prettyprint-override"><code>{
    'title': "Epic Film",
    'genre': "action adventure"
},
{
    'title': "Sappy Love Story",
    'genre': "romance"
}
</code></pre>

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

<blockquote>
  <p>Genre cannot be blank.</p>
</blockquote>

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

<json><plugin-feedme>
Feed Me: Importing a relationship between elements
# Feed Me: Importing a relationship between elements

(Asked by: username_0 on 2017-05-15)

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?

**Tags:** json, plugin-feedme

---

## 1 answers

### Answer by username_1 on 2017-05-15. Score: 3 | Accepted answer

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](https://i.sstatic.net/yk63L.png)](https://i.sstatic.net/yk63L.png)

Can you check this?

> **Comments:**
> **username_0**: That was it! Can't believe I overlooked that dropdown. Thanks! :)  

---

