Need to set multiple variables from collections inside an array

Hey! I’m having a lot of trouble setting multiple variables from collections. As you can see in the picture, I have an array “Fields” that has 16 collections. Each collection has different values, including “Field ID” and “Value”. I have 20 different variables I want to set, and each collection contains one. For example, the collection with the field id price-per-ad-run will only contain the value I want for price per ad run, and the same for the other 19

Here is part of the JSON it returns:
{
“id”: “Wr8ACtZyQZqGtMu3wYvxFi”,
“name”: “29/11/2023 - Contract (Annex + T&C) v1.3 | Mail + Ads”,
“date_created”: “2024-02-22T10:44:03.576Z”,
“date_modified”: “2024-02-22T10:52:36.473Z”,
“expiration_date”: “2024-04-22T10:52:35.798Z”,
“autonumbering_sequence_name”: null,
“created_by”: {
“id”: “fuXE4bUAxa74MAbpAC8YcE”,
“email”: “mail”,
“first_name”: “Guille”,
“last_name”: “…”,
“avatar”: null,
“membership_id”: “K4GcTcircWG2zHFHoR9nnU”
},
“metadata”: {},
“tokens”: ,
“fields”: [
{
“field_id”: “pricePerAdRun”,
“uuid”: “1be4c15a-9996-4f0c-ac11-58b10156a566”,
“name”: “Text”,
“title”: “”,
“placeholder”: “Enter value”,
“value”: “10000”,
“assignee”: “mail”,
“assignee_details”: {
“id”: “dTggkt4TJXyHzg78pSXZZP”,
“first_name”: “Guille”,
“last_name”: “…”,
“email”: “mail”,
“phone”: “”
},
“type”: “text”,
“merge_field”: null
},
{
“field_id”: “Text3_1”,
“uuid”: “465db3f6-c2de-4f74-ba8f-42c19be0c4ea”,
“name”: “Text”,
“title”: “”,
“placeholder”: “Enter value”,
“value”: “3e”,
“assignee”: “mail”,
“assignee_details”: {
“id”: “dTggkt4TJXyHzg78pSXZZP”,
“first_name”: “Guille”,
“last_name”: “…”,
“email”: “mail”,
“phone”: “”
},
“type”: “text”,
“merge_field”: null
},
{
“field_id”: “Text2_1_1_1”,
“uuid”: “4910fbe1-c5a6-4abe-bf19-9a8d12999143”,
“name”: “Text”,
“title”: “”,
“placeholder”: “Enter value”,
“value”: “3e”,
“assignee”: “mail”,
“assignee_details”: {
“id”: “dTggkt4TJXyHzg78pSXZZP”,
“first_name”: “Guille”,
“last_name”: “…”,
“email”: “mail”,
“phone”: “”
},

You can use the built-in function map, followed by get or first

e.g.:

{{ first(map(1.fields; "value"; "field_id"; "pricePerAdRun")) }}

For more information, see the highlighted links below

Links

Here are some useful links and guides you can use to learn more on how to use the Make platform, apps, and app modules. I found these useful when I was learning Make, and hope they might benefit you too —

General

Help Center Basics

Articles & Videos

3 Likes

Incredible, really appreciate the fast response! Thanks!

1 Like

No problem, glad I could help!

1. If you have a new question in the future, please start a new thread. This makes it easier for others with the same problem to search for the answers to specific questions, and you are more likely to receive help since newer questions are monitored closely.

2. The Make Community guidelines encourages users to try to mark helpful replies as solutions to help keep the Community organized.

This marks the topic as solved, so that:

others can save time when catching up with the latest activity here, and

  • allows others to quickly jump to the solution if they come across the same problem

To do this, simply click the checkbox at the bottom of the post that answers your question:
Screenshot_2023-10-04_161049

3. Don’t forget to like and bookmark this topic so you can get back to it easily in future!

2 Likes