How to save data items from JSON-LD responses API in the databse collection?

Hi everyone!!

I was trying without success, let me explain us, I get a JSON object from an API, and I was wondering how to save certain data from the JSON into the database collection, on order to show it for the user, when I get the JSON from the API whit the fentch, the console shows like this.

Here is the items that I need 0, 1, 2, etc…

In adition the API have a scurity schema API Key (Headerparameter name:X-API-Key), I don’t have many experience with coding, but I found the way to pass the key with the backend modules. Now I get stuck whit getting the information to used in the page.

I also read this post https://www.wix.com/corvid/forum/community-discussion/inserting-the-json-file-data-into-a-database , but with the JASON viewer I have symbols in the structure that isn’t match with the name fields of the wix databse, or the wix code, for example:

In the JSON viewer I have this structure:

If you noticed, I have “hydra:member”, in acording whit the insert function from the wixData library I can declare the fields that I whant to insert into the database for example:


But obviously I can’t write hydra:member, or 0, there is a way to save the JSON in a database?

Hi guys!, if it works for you I already found the solution.

To process the elements from the server that I have the response I used the following symbols, instead to use:

let rfc = items.hydra:member.0.iusser.rfc; //this not works for javaScript

let toInsert = {
 "rfc": rfc
}

wixData.insert("Collection", toInsert)

I tried this and its works!

let rfc = items.['hydra:member']['0'].iusser.rfc; //this really works for java

let toInsert = {  
    "rfc": rfc 
}  
wixData.insert("Collection", toInsert)

finally here is the JSON-LD structure: