|
|
Plan Availability | All plan types with varying limitations |
Permissions | Solution Creators – Can create, modify, and manage automations in Solutions they manage |
Related Reading |
SmartSuite’s Looping action allows you to automate workflows by iterating through lists of data—often coming from webhooks. This article explains how to configure JSON arrays for use with the Looping action.
🧠 What’s a JSON Array?
A JSON array is a list of items—either simple values like text or numbers, or structured objects (like customer or order records). In automation, looping over this array lets you perform an action on each item individually.
✅ Supported JSON Array Structures
SmartSuite supports two types of JSON array structures for looping:
1. Top-Level Arrays
These are arrays where the list itself is the root of the JSON response.
Example:
["SKU-ABC-123", "SKU-DEF-456", "SKU-GHI-789"]
Input List: Set to the full Webhook Trigger Output.
Current item: Represents one string (e.g.,
"SKU-ABC-123"
) per loop.No dropdown appears—these are plain values.
2. Arrays Nested Under a Key (Object Children)
Here, the JSON is an object and the array lives under a specific key (like customers
or items
).
Example: Customer List
{ "status": "success", "customers": [ { "id": "cust-001", "name": "Alice Smith", "email": "alice@example.com" }, { "id": "cust-002", "name": "Bob Johnson", "email": "bob@example.com" } ] }
Input List: Webhook Trigger Output >
customers
Current item: Each loop gives a full object (like a customer)
Dropdown available to select
id
,name
, oremail
Example: Order Items
{ "order_id": "ORD-999", "items": [ { "product": "Laptop", "quantity": 1, "price": 1200 }, { "product": "Mouse", "quantity": 2, "price": 25 } ] }
Input List: Webhook Trigger Output >
items
Dropdown access to
product
,quantity
,price
⚠️ Key Tips and Limitations
Single-Level Nesting Only: The Looping action doesn’t support arrays inside arrays.
Smart "Current Item" Behavior:
Simple types (e.g., strings): no dropdown.
Object types (e.g., customer record): dropdown for field selection.
Array Length: No strict limit, but large arrays may impact performance.
Field Selection: Use the dropdown to pick the correct array in your webhook response.
🔄 Real-Life Examples
📂 Project Management
Scenario: Tasks are assigned via webhook from an external tool.
Webhook Payload:
{ "user_id": "user-123", "assigned_tasks": [ { "task_name": "Prepare Project Plan", "due_date": "2024-11-20", "priority": "High" }, { "task_name": "Conduct User Research", "due_date": "2024-11-25", "priority": "Medium" } ] }
Input List:
assigned_tasks
Loop Action: Create a new task record
task_name
→ Task Titledue_date
→ Due Datepriority
→ Priority
🛒 E-commerce
Scenario: New order received via webhook with item details.
Webhook Payload:
{ "order_number": "ORD-567", "order_items": [ { "product_id": "PROD-111", "name": "T-Shirt", "quantity": 2, "unit_price": 25.00 }, { "product_id": "PROD-222", "name": "Jeans", "quantity": 1, "unit_price": 75.00 } ] }
Input List:
order_items
Loop Action: Create Order Line Item records
product_id
→ Product IDname
→ Product Namequantity
→ Quantityunit_price
→ Unit Price
🎟️ Event Management
Scenario: Register attendees using a list of emails sent via webhook.
Webhook Payload:
{ "event_id": "EVENT-001", "new_registrations": [ "attendee1@example.com", "attendee2@test.net", "guest3@domain.org" ] }
Input List:
new_registrations
Loop Action: Create attendee records
Use
Current item
as the Email Address (simple string)
📝 Final Notes
Always preview your webhook data to find the correct array for looping.
The Looping action works great for repetitive tasks like creating records, updating fields, or sending notifications—one item at a time.
Use "Current item" smartly depending on whether you're working with plain text or objects.