The premium action Array Functions allow users to performing operations on arrays (lists of data). With these powerful premium actions, users can manipulate, filter, and extract information from data arrays to automate tasks more efficiently.
TABLE OF CONTENTS
- What are Array Functions?
- Key Benefits of Array Functions
- How to Set Up Array Functions
- Frequently Asked Questions
- Related Articles
- Next Steps
What are Array Functions?
Array Functions are a set of premium workflow actions in HighLevel designed to manage and manipulate arrays (lists of data) within automation workflows. Arrays appear in workflows when dealing with lists of objects, such as order line items or customer attributes, and Array Functions enable users to extract, filter, or calculate data efficiently. These functions are particularly valuable for businesses that want to handle basic data processing exclusively in Workflows, rather than having to export data to a 3rd party service more manipulation or analysis.
Key Benefits of Array Functions
Using Array Functions in HighLevel workflows provides numerous advantages for automation, data processing, and task efficiency. Below are the primary benefits:
- Enhanced Workflow Automation: Automate tasks that require filtering, sorting, or calculating data without sending the data to an external 3rd party service.
- Improved Decision Making: Extract meaningful insights from datasets in real-time.
- Reduced Manual Errors: Automate complex calculations and data manipulations.
- Customizable Actions: Tailor workflows to unique business needs with flexible array operations.
How to Set Up Array Functions
Follow these steps to set up and use Array Functions in a workflow:
Step 1: Access Workflow Builder. Open the HighLevel application, navigate to the Automation tab, and create or select a workflow.
Step 2: Add Array Function Action. Click “Add Action” and select “Array Function” under the Premium Actions section.
Step 3: Choose Function Type. Select the desired array function from the options: Find, Filter, Find by Index, Line Items, or Math.
Step 4: Configure Inputs. Specify the input array. Define keys, values, or criteria based on the selected function type.
Step 5: Save and Test. Save the workflow and test the action to ensure it’s working as intended.
Step 6: Use The Value. When the action is working it will create a variable that you can reference in other actions.
Detailed Explanation of Array Functions
Each Array Function type is tailored to perform specific operations on array data. The list of available array data is collected from Shopify Triggers, Inbound Webhook Trigger and Custom Webhook action response data.
Below is a breakdown of the available functions:
Find
The Find action will locate a specific object in an array by matching a key-value pair. For example, Finding whether a specific product, such as "Laptop," exists in a list of purchased items. If a match exists, it will be returned. Find will return only one object, the first object that matches.
For example, using Shopify Order Placed Trigger and checking if a product with product id "zGhad23wfadfa" is part of the Shopify line items. Step 1: Select Action Type Find | |
Step 2: Select Shopify > Line Items | |
Step 3: Pick the Key and input the Value to match. | |
Step 4: Review the available Line Item Keys. | |
Step 5: In this example, select the "id" Key and paste in the specific product id as the Value. |
Find by Index
The Find by Index Action will return one item based on it's array position. The array always starts at zero (0). So if there are three (3) items in the array they will be numbered like this: (0) Apple, (1) Banana, (2) Cherry. A request for the item at index position two (2) will return the third item in the list, in this case Cherry.
Filter
The Filter Action will return an array of all the objects that match a given filter (or set of filters). For example, all of the objects that have the color "blue" or all of the objects in the category "home".
For example, you can filter an array down to only a certain person. By setting the Key to "id" and the Value to the dynamic {{user.name}} you could get all of their orders.
Line Items
The Line Items action type allows you to rebuild/reconstruct arrays to fit a target action, such as a custom webook, storing in Google Sheets, or matching Email Builder shopping cart structure. You can customize the key-value pairs in each item. This takes in one array and outputs the same data in a different array you specified.
Math
The Math Functions Action has several options like Sum or Avg to be performed on the numbers in an array. For example, all of the prices can be Summed together to get the total order value. The result of the math will be returned. The Math operations are:
- Sum: add all of the values, return the total.
- Min: find the smallest value, return it.
- Max: find the largest value, return it.
- Average: add all of the values and divide by the number of values, return the mean.
- Count: count the total number of values, return it.
Frequently Asked Questions
Q: What type of data can be used with Array Functions?
A: Array Functions work with arrays (lists) of objects or numbers. Arrays often come from triggers like form submissions, order line items, or API responses.
Q: Are Array Functions a premium feature?
A: Yes, Array Functions are part of HighLevel’s premium workflow actions and will incur a small fee every time they run.
Q: Can Array Functions handle nested arrays?
A: No, Array Functions are currently designed to handle one-dimensional (flat) arrays. Additional processing for nested data requires custom solutions.
Q: Can I use multiple Array Functions in the same workflow?
A: Absolutely. You can chain Array Functions together to perform complex operations.
Q: How do I debug issues with Array Functions?
A: Use the “Test Workflow” feature in the builder to view outputs and ensure proper configuration.
Related Articles
Next Steps
- Review your workflows to identify areas where Array Functions can automate processes.
- Explore additional premium actions, such as Custom Code, for advanced automation needs.
- Ensure all users managing workflows are trained on Array Functions for optimal utilization.
Was this article helpful?
That’s Great!
Thank you for your feedback
Sorry! We couldn't be helpful
Thank you for your feedback
Feedback sent
We appreciate your effort and will try to fix the article