Overview
When using for loop actions in Agent.ai, you might run into issues if you’re working with multi-select dropdowns. The problem usually comes down to format: for loop expects a very specific type of input, and the raw output from a multi-dropdown list might not be an exact match. This guide walks you through how to inspect your input, transform it using a built-in LLM, and successfully run a loop with multi-dropdown values.Required Format for for loop
Agent.ai’s for loop requires a plain list of strings in the following format:- Must include square brackets []
- Each item must be in quotes
- Items must be separated by commas
Step 1: Inspect Multi-Dropdown Output
Multi-dropdown inputs do not return a list of strings. Instead, you’ll get a list of objects that looks like this:Step 2: Transform the Input
To convert this into a usable format, insert an LLM action before the the loop action. Use a prompt that extracts only the value fields and returns a plain list of strings.Example Prompt
You will receive a JSON array of objects. Each object has a “label” and “value.” Your task:- Extract the “value” from each object
- Return a plain Python list of strings
- No extra text, no code block formatting, no JSON structure
- Only output something like: [“LinkedIn”, “Twitter”]