I need to request missing data through a custom JavaScript code

Good afternoon, I am quite new to using Eazybi and I have a need that I am not sure how to accomplish.
I downloaded data through the REST APPI to generate a report in which I would like to see a table with the user name, the different products they use, the email, the instance where the product is hosted and what the last activity was. In addition to other data.
My problem arises because the APPI download did not bring me all the data I need.

I am attaching a Postman view that exemplifies the information I need to work with.

The APP download that I made only brings me the first data, that is, only the object but not the attributes.

“account_id”: “5c******a5",
“account_type”: “atlassian”,
“account_status”: “active”,
“name”: "Omar V
a",
“picture”: “”,
“email”: "omar.ve
a@*****global.com”,
“access_billable”: true,
“last_active”: “2024-10-08T17:11:18.240576Z”,
“product_access”: [

I was told that I should request the missing attributes via custom JavaScript code in the Content Parameters section, but I’m not sure how to write the corresponding code. Would it be possible for you to help me with this? Thank you very much.

Hi @GabrielaGut

The product_access is an array of several products In order to group and filter data by products, you should modify the REST API result with JavaSript to create separate rows for each product, you can use custom JavaScript code in the

In the “Content Parameters” section, you can add JavaScript to modify the REST API result to make it more suitable for data mapping. The method is to generate a separate row for each account_id and product combination received with REST API, not a single row for each account.

Please see the JAvaScript example here: Import from REST API.
The code might look like this:

return _.map(doc.product_access, function(line) {
  return {
    name: doc.name,
    account_id: doc.account_id,
    account_status: doc.account_status,
    email: doc.email,
    last_active: doc.last_active,
    product: line.name,
    product_last_active: line.last_active,

  };
});

Best,
Zane / support@eazyBI.com