Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to select desired primary element #1414

Open
karljennings opened this issue Mar 15, 2024 · 0 comments
Open

Unable to select desired primary element #1414

karljennings opened this issue Mar 15, 2024 · 0 comments
Labels

Comments

@karljennings
Copy link

Description

I am consuming a JSON API feed from a third party with the following structure which is being used to try and import entries. However it appears the duplicated data keys are causing an issue with selecting the desired primary element to import.

{
    "success": true,
    "data": {
        "current_page": 1,
        "data": [
            {
                "id": 1,
                "name": "Event name",
                ...
            },
            {
                "id": 2,
                "name": "Event name",
                ...
            },
            ...
        ]
    }
    ...
}

I am looking to import the data array which as demonstrated below is not shown as an option.

Screenshot 2024-03-15 at 09 35 29

I have set up a secondary feed to test the data structure and have renamed the data array to events which produces the following desired outcome:

{
    "success": true,
    "data": {
        "current_page": 1,
        "events": [
            {
                "id": 1,
                "name": "Event name",
                ...
            },
            {
                "id": 2,
                "name": "Event name",
                ...
            },
            ...
        ]
    }
    ...
}

Screenshot 2024-03-15 at 09 39 35

I have also mapped the fields for this second test feed and successfully imported.

Unfortunately asking for the key to be renamed in the API is not an option. Data structures are identical but the duplicated data key seems to cause the issue. I am wondering if there's any workaround or explanation to why this might be as I couldn't find anything in the documentation.

Thanks.

Additional info

  • Craft version: 4.8.0
  • PHP version: 8.1
  • Database driver & version: MariaDB 10.4
  • Plugins & versions: Feed Me 5.4.0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant