I followed the instructions on this page:
I did this
I don’t get one record per row
I get this
How do I get one record per row?
I followed the instructions on this page:
I did this
I don’t get one record per row
I get this
How do I get one record per row?
It looks like your Call API returns a JSON collection. What you need to do is number the rows in your table, starting at zero, then use that with a JSON Query column to extract each item in the collection, one per row.
If you can post a sample of the JSON (please enclose in triple backticks so it’s formatted correctly), then I can probably help a bit further.
My man
{
"success": true,
"data": [
{
"id": "c0b059d0-b144-11ef-ac0b-c76b0d4251c7",
"title": "Fruit Co lead",
"owner_id": 22602236,
"creator_id": 22602236,
"label_ids": [],
"value": null,
"expected_close_date": null,
"person_id": 9,
"organization_id": 6,
"is_archived": false,
"source_name": "Manually created",
"origin": "ManuallyCreated",
"origin_id": null,
"channel": null,
"channel_id": null,
"was_seen": true,
"next_activity_id": null,
"add_time": "2024-12-03T07:03:52.045Z",
"update_time": "2024-12-03T07:03:52.045Z",
"visible_to": "3",
"cc_email": "pure-legal+13684333+leadbeob78epxakvayf8d0hjcal6v@pipedrivemail.com"
},
{
"id": "f2922050-b144-11ef-ac0b-c76b0d4251c7",
"title": "Animals Co lead",
"owner_id": 22602236,
"creator_id": 22602236,
"label_ids": [],
"value": null,
"expected_close_date": null,
"person_id": 10,
"organization_id": 7,
"is_archived": false,
"source_name": "Manually created",
"origin": "ManuallyCreated",
"origin_id": null,
"channel": null,
"channel_id": null,
"was_seen": true,
"next_activity_id": null,
"add_time": "2024-12-03T07:05:15.733Z",
"update_time": "2024-12-03T07:05:15.733Z",
"visible_to": "3",
"cc_email": "pure-legal+13684333+leadeczkhsevf6as2z9cn5voyeklj@pipedrivemail.com"
}
],
"additional_data": {
"pagination": {
"start": 0,
"limit": 100,
"more_items_in_collection": false
}
}
}
Yes it returns a collection with metadata
Which specific bits of information are you interested in?
Actually, let’s just say you want the title of each one. I’d probably use a JavaScript column, like this:
const json = JSON.parse(p1);
return json.data[p2].title;
If you need some other attributes, do the same thing and modify the second line.
Thanks. I can’t use any of the json integrations to query data out of a record?
Also, use case is: label a lead in pipedrive crm, then only those records appear in glide.
If I am getting diff data each time I call api, then I assume the static row numbers in glide table won’t matter right?
You could use the Query JSON column, but that would require an extra template column to combine the row index with the attribute. So I find it easier to use a JavaScript column.
No, that shouldn’t matter. Important thing is you have enough numbered rows in your table to cover the maximum number of expected results.
Do you think glide will create a native solution for this? Must be reasonable common.
Wait do I need that template column for my JSON? Or can I use the call API column?
Oh is that to strip out the meta data?
Yes, just use the output of your Call API column as the p1
parameter in the JavaScript column.
Generally you can ignore that error. You’ll get it if the p1
value is empty on any row, or if you have more rows than items in the JSON collection.
got it thx mate, I’ve added logic to my JS to check values exist to avoid this.
Basically building this for a client.
FYI, you are sharing your API token with the world. Might want to change that.
thanks, nah that is just a small part of the key
Table:
How do I get these results (there are x 10) into their own rows in Glide?
I know I can query out an individual record by adding an index column with numbers from 0…9, however, based on my table (above) I’m not sure how I create all the rows I need after I get the API response?
So those rows need to be static, not just “temporary” for viewing purposes right?
Do you have access to Call API?
They will actually be temporary. I’m still working on the flow TBH.
The idea is you can search for companies that are similar to another company and get a results (above).
The I want each result to be a row/record in a table.
I think I might have a search be a record and then results will be related records (one search has many results) and each new search has new results. Current thinking.
Eventually I want to be able to click a result in the UI and view its details and edit and then send to CRM to create a lead (not really important, just context).
Yes I have call api
Please adapt this method with a helper table.
thanks, can you explain helper table?
I think I’m going to create an action that populates a table using the request ID as an identifier, so each set of results is can be listed in the UI.
I get the transpose method, that is a mission to set up though