1

I've successfully exported product entries out of an ancient version of ExpressionEngine (1.7.1) into a JSON file and for the most part I've successfully imported that JSON using FeedMe—except for two things: Categories and a field that is a Dropdown menu in Craft.

The most important thing is the Categories (I can live without the dropdown field if I have to), but I thought I'd mention it because I thought the solutions might be related.

In Craft I have a Category Group with Existing Categories. What I want to do is have the entries I import match into those existing categories; the Craft Categories are an exact copy of the old ExpressionEngine categories so they are exactly the same.

I can't figure out what FeedMe/Craft is looking for to "match" the JSON category field to the corresponding existing category. I've tried the cat name and the cat slug. I've also tried Cat Id but I'm not sure I had the right Id value (I couldn't find an obvious place where the Cat Id is listed in Craft so I did an export on the Categories page and tried what I found in there).

Here is a simplified version of the JSON I'm importing:

[
  {
    "title": "Product: A type of Chair",
    "dropdown": "Chair",
    "category": "Wing Chair",
    "description": "Text here"
  }
]

I actully have many more fields, which all import fine, but the category and dropdown won't no matter what I try.

In the FeedMe Content Fields when I choose the Feed Element for the Category field (which I'm able to select) but under it there is a drop down with instructions that say:

Data provided for this category is:

And the drop down is a listing of all the possible Craft fields, EXCEPT for the Craft Category field; so I'm completely confused by this.

I'm sure this is something basic that I'm just missing, but I'm new to Craft/FeedMe and none of the other quesions on here that I could find were matching existing categories.

1

For the category, you need to pass an array of objects and choose to match on title (or ID if you have them).

For the dropdown, pass in the value, not the label and it will work. Try this:

[
  {
    "title": "Product: A type of Chair",
    "dropdown": "valueNotLabel",
    "category": [
      {
        "id":"1234"
        "title":"Wing Chair"
      },
      {
        "id":"5678"
        "title":"Another category"
      }
    ],
    "description": "Text here"
  }
]

To find your category ID, you can click the small cog (customize) on your Categories page in your control panel and add the ID column to your table.

2
  • Ah, thanks! I'll give that a try and report back. Dec 11 '20 at 18:37
  • Worked like a charm! Thanks so much for the help. Dec 11 '20 at 18:51

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.