Call array variables sequentially (if no answer is found via first array entry)

Hi all,

For my search contact flow, I am building a dynamic HTTP search that needs to run sequentially based on previously set variables.

In a previous question, we have solved how to call the variables dynamically in the http request module via defining them as an array and iterating over it, however the core purpose of the set up is for the ‘runs’ to be sequential:

  • We start by defining a variable ‘contact person 1’
  • We define different roles as part of the search ‘runs’
  • we run the first search based on the roles defined for run1
  • if we find a contact via the http (api) module, we save it as variable ‘contact person 1’
  • if we did not find a contact person with these roles (as defined in run1), we use the roles defines in run2

Or in simpler terms: The purpose is, that ‘run1’ executes first, searches for someone and if it doesnt find a person (i.e. the end of the execution did not set a variable for contact person 1), then ‘run2’ executes. Similar to how the repeat module would go through something sequentially.

Previously, I had build it dynamically with the repeater module, but then it wasn’t possible for me to call the variables ‘run1’ etc in the http module dynamically based on the repeater cycle (see post here Dynamically call a previous value - #7 by jmal). Blueprint for this scenario is attached as blueprint (2).

Thanks to help in the previous post, we redefined the variables as arrays (attached blueprint (4)) but do not yet have the sequential element needed. Any support is greately appreciated! :))

blueprint.json (27.3 KB)
blueprint (2).json (29.8 KB)

Hello @jmal;

We have access prior data during repeaters run by using Set and Get Variable modules.

Upfront, I set my initial values, run the repeater, grab the variable, do stuff, then set the variable. On the next repeater run, get the prior variable value for use.


Using Get and Set Variables works well for passing information between scenario branches, too.

blueprint (1).json (8.1 KB)

For your initial question, knowing now how to access variables from branches and repeated runs, you can better control sequential array calls.

Conceptually, I’ll start with a continue=true. After the repeater, get continue, use a filter to check that continue=true. Later on, set continue to false. So on the next repeater run, filtering prevents the continuation.

Good luck!

1 Like

Thanks a lot! interesting to get and set the variables for the next repeater run within the repeater. Very cool!

I played around with it a bit and managed to get it working with the original set up, where I set up a new variable that I ‘dynamically’ change in the repeater run to the search variable I need then.

The Continue = true / false I will replace with the contact variable being empty or not directly just to reduce # variables in use :slight_smile:

blueprint (5).json (13.6 KB)

2 Likes

Congratulations on the success here, and I’m glad I was able to help.

1 Like