Get an Element From an Array Tool
IN THIS ARTICLE
The Get an element from an array tool is a feature that lets you get a specific element from an array by its position number. You can easily select the element you want to receive by indicating its position number. Element numbering starts from 1.
Let's say you have a list of items in an order, such as "Hat", "T-shirt", "Shorts". But you only need to pass one item to your CRM system. With this tool, you can indicate the position of the item you need to receive. For example, if you want to get the second item in the list, indicate the position number (2), and Albato will pass only "T-shirt" from the entire list.
If you enter a number in the Position field that is outside the number of elements in the list (e.g., there are three elements in the list, but you enter 0, -1, or 5), an error will occur in the tool step log with the message "The entered number does not match the number of elements in the array".
Example 1
The automation will receive data from Trello card and pass it to HubSpot, where users and their order for the first item in the card will be created.
Make sure that Trello and HubSpot are connected to Albato.
To get started, click the New button. Set up the first step.
Choose a source app, specify a trigger, add your connection.

Add the tool before you move on to the next step in your automation. To do this, click on the "+" and select the tool you need from the list.

Now, it's time to fill in the fields.

Add and set up the next step of your scenario - action.
Choose an app, specify an action, add your connection.

We'll pass the first element. You can select any element from the list that you need.

Your automation is ready! Don't forget to run it.
Example 2. Extracting a Phone Number from an Array in Pipedrive
In this example, you will configure an automation that detects when a deal is marked as lost in Pipedrive, retrieves the contact information, extracts a single phone number from the phone array, and then updates or creates the contact in RD Station.
The automation structure looks like:
Deal Update → Find a Client by ID → Get an element from an array → Router → Find Lead → Router → Create/Update contact → Create event

Step 1. Configure the trigger
Create a new automation and add a new trigger:
Pipedrive → Deal Update
Then configure the filter:
- Field → Deal status
- Condition → Equals
- Value → lost
This ensures the automation runs only when a deal is marked as lost.
At this stage, the system receives deal data, including the Person ID related to the deal.
Step 2. Add an action to retrieve contact details
Add a new step:
Pipedrive → Find a Client by ID
In Map your fields, configure:
- The ID of the person (required) → Select Deal Update → Person ID
This action retrieves the full contact data from Pipedrive. Among the returned fields are:
- Primary email
- Phone numbers
Important: the Phone numbers field is returned as an array, even if the contact has only one phone number.
Example structure:
Phone numbers:
- +123456789
- +987654321
At this stage, the phone number cannot be directly passed to RD Station if that field expects a single value.
Step 3. Add the tool to extract one phone number
Add a new step and select: Tool → Get an element from an array


In the settings, configure it as follows:
- Element → First element
- Row section element → Select Find a Client by ID → Phone numbers → Phone

This tool receives the full phone numbers array and extracts only the first element.
- If multiple phone numbers exist, only the first one is returned.
- If only one number exists, that value is returned.
The result of this step is a single string value that can be safely used in the next actions.
If you enter a position number that does not exist in the array (for example, 5 when only 2 elements exist), the automation log will display the error:
“The entered number does not match the number of elements in the array.”
Step 4. Add a Router to validate the data
Add a Router step to control the flow.
Here you can configure conditions to check:
- Whether required fields exist
- Whether the email field is not empty
- Or any other condition required before proceeding
This prevents errors in the next steps.
Step 5. Add the action to find the lead in RD Station
Add the next step:
RD Station → Find Lead
In Map your fields, configure:
- Email (required) → Select Find a Client by ID → Primary email

This step checks whether the contact already exists in RD Station.
The phone number extracted in Step 3 will be used later when creating or updating the contact.
Step 6. Add a second Router
Add another Router to determine the next path:
- If the lead exists → proceed to update
- If the lead does not exist → proceed to create
This prevents duplicate contacts from being created.
Step 7. Add the action to create or update the contact
Add the step:
RD Station → Create/Update contact
In Map your fields, configure:
- Email → from Step 2 (Primary email)
- Phone → from Step 3 (output of Get an element from an array)
Because the phone number has been converted from an array into a single string value, RD Station can now accept it correctly.
Step 8. Add the final action
Add the action:
RD Station → Create event "Mark opportunity as lost"
This logs the lost opportunity inside RD Station.
Conclusion
In this automation, Pipedrive returns phone numbers as an array, even when there is only one phone number. RD Station, however, expects a single value.
By adding the Get an element from an array tool, you extract one specific value from the array and convert it into a single string that can be safely passed to the next step.
This scenario commonly occurs when working with multi-value fields such as phone numbers, emails, order items, or custom fields.
The tool allows you to extract:
- the first element
- the last element
- or a specific element by position
Numbering always starts from 1.
Did this answer your question?