Json into table

Hello!
Im very new to retool and have encountered javascript only in passing.
I'm currently struggling to connect a table item with data in json I have from the Scopus API.
I already tried to use a transformer but I fear my lack of knowledge doesn't make it easier for me.

here is a snippet of my json:

"prism:url": "https://api.elsevier.com/content/abstract/scopus_id/85214915776",
        "dc:identifier": "SCOPUS_ID:85214915776",
        "eid": "x-xxxx-xxxxxxxxxxx",
        "dc:title": "Research on Efficiency Coupling Coordination Feature Model of Digital Economy Based on Multi-Objective Machine Learning Algorithm",
        "dc:creator": "Cui X.",
        "prism:publicationName": "Tehnicki Vjesnik",
        "prism:issn": "13303651",
        "prism:eIssn": "18486339",
        "prism:volume": "32",
        "prism:issueIdentifier": "1",
        "prism:pageRange": "78-87",
        "prism:coverDate": "2025-12-31",
        "prism:coverDisplayDate": "31 December 2025",
        "prism:doi": "10.17559/TV-20240826001943",
        "citedby-count": "0",
        "affiliation": [
          {
            "@_fa": "true",
            "affilname": "South-Central Minzu University",
            "affiliation-city": "Wuhan",
            "affiliation-country": "China"
          }
        ],
        "prism:aggregationType": "Journal",
        "subtype": "ar",
        "subtypeDescription": "Article",
        "source-id": "14569",
        "openaccess": "0",
        "openaccessFlag": false
      },
      {
        "@_fa": "true",
        "link": [
          {
            "@_fa": "true",
            "@ref": "self",
            "@href": "https://api.elsevier.com/content/abstract/scopus_id/85214906730"
          },
          {
            "@_fa": "true",
            "@ref": "author-affiliation",
            "@href": "https://api.elsevier.com/content/abstract/scopus_id/85214906730?field=author,affiliation"
          },
          {
            "@_fa": "true",
            "@ref": "scopus",
            "@href": "https://www.scopus.com/inward/record.uri?partnerID=HzOxMe3b&scp=85214906730&origin=inward"
          },
          {
            "@_fa": "true",
            "@ref": "scopus-citedby",
            "@href": "https://www.scopus.com/inward/citedby.uri?partnerID=HzOxMe3b&scp=85214906730&origin=inward"
          }
        ]

here is my error when I want to connect the json data

Retool_err_msg

Thank you for any help in advance!

2 Likes

Hi, welcome to the community.

It would depend on what information you want to show in the table, but I took the sample JSON data from the Scopus API page and with a little manipulation I produced this:

The thing to not is the dot notation to drill down through the data that the API is returning to get to the entries you want to show in the table.
I'm doing that in this example with {{ variable1.value['search-results'].entry }}
In your case this might need to be {{ searchScopus.data['search-results'].entry }}

Thank you!
now the table displays something.

What I want to show is exactly what you had in your screenshot, unfortunately my table only shows the following:


I added column 5 to try and display the other entries.
I dont really understand how to navigate within the json file nor why only these columns are shown.
If you have any ressources to read up on the topic I would be glad to have them.

Thank you in advance.

There's lots of material on JSON and thousands of tutorials, I don't think there's one in particular I'd point to as being better than others because, honestly, it's a pretty straightforward format and all tutorials will cover the same ground.

As for your particular issue, I'd suggest letting the Retool Table component do most of the work for you here and try click on the "regenerate columns" button so it can make sense of the data and try its best to format it for you.
image

I've also exported a simple table that uses the sample data from scopus search as a REST API call, so should be more similar to your app, I hope this helps.
I used the information on this page

forum (1).json (22.8 KB)

1 Like

Thank you so much!

I didn't know that was an option.

1 Like