array.forEach
Using this function, you can iterate over a source array and filter the array elements based on a condition. If you do not provide any arguments, you can also create a single-item array.
array.forEach() function.Syntax
array.forEach(items, scopeName, filter)
Arguments
If you do not provide any arguments, you can create a single-item array.
| 
                                         Argument  | 
                                    
                                         Type  | 
                                    
                                         Description  | 
                                
|---|---|---|
| 
                                         items  | 
                                    
                                         array  | 
                                    
                                         Source array to iterate over.  | 
                                
| 
                                         scopeName  | 
                                    
                                         
  | 
                                    
                                         Scope for your mapping. Each scope has a name to it. By default, the scope name is the same as the name of the source array. To use data: 
  | 
                                
| 
                                         filter  | 
                                    
                                         
  | 
                                    
                                         Condition to filter the array elements. To use a filter, provide a scope name as the second argument and a boolean condition as a third argument. In the filter condition, you can use data from: 
  | 
                                
Returns
| 
                                         Type  | 
                                    
                                         Description  | 
                                
|---|---|
| 
                                         array  | 
                                    
                                         The output array with filtered elements  | 
                                
Examples
array.forEach($flow.parameters.headers)returns arrayarray.forEach()returns arrayarray.forEach($flow.parameters.headers, "headerScope")returns arrayarray.forEach($flow.parameters.headers, "headerScope", $loop.Accept == "application/json")returns array