Dynamically call a previous value

Hi all,

I am stuck :sweat_smile:

In my flow, I set some variables called ‘search1’, ‘search2’ and ‘search3’. I then use a repeater to cycle through this search values for an API call.

I can ‘get the variable’ dynamically (i.e. if i use the get variable module i get the right output), but I can not use it further down in the flow for the API call (as the output of ‘Get variable’ is the variable itself and not the value (a bit hard to explain).

Then I thought I would set a new variable dynamically referencing the search variable, see screenshots (but that also gives me an error). Is there any way I can get this done?

Thanks a lot!!
Screenshot 2024-08-09 140650

You can delete the {{ }} brackets. This is mostly used only when copying and pasting the code from elsewhere.

You can manually type the search function this way:

search(

Then the editor will replace it with the proper formatting with the start and end brackets ( )

You can also select the function from the variables panel.

I would suggest completing the Make Academy before jumping into building a complete scenario.

Hope this helps! Let me know if there are any further questions or issues.

@samliew

Thanks again @samliew !

I dont think the solution works in this case, I think I was maybe not quite clear in my description and the term ‘search’ was misleading (it was the term I used to call the variables). For clarification, I have renamed the variables to run1, run2, run3 etc. in module 59 in the screenshot in original post.

My issue is that I can use the repeater to dynamically call the variables in the different repeat runs through the ‘get variable’ module (see screenshot), but I cannot set the variable to be taken dynamically in the subsequent HTTP module (where I can only reference a ‘concrete’ result from a run of the get variable output, but not the output ‘generically’ dependent on the run). I attached a screenshot of the HTTP module in which I want to use the variable ‘run1’, ‘run2’ etc dependent on the iteration of the repeater run.

Maybe what you suggested still works, and I just dont know where to properly insert it - could also be. Will check out more of the videos for sure :slight_smile:

Screenshot 2024-08-10 154830
Screenshot 2024-08-10 154845

To allow us to assist you with your scenario, please provide the following:

1. Scenario Blueprint

Please export the scenario blueprint file to allow others to view the mapped variables in the module fields. At the bottom of the scenario editor, you can click on the three dots to find the Export Blueprint menu item.

2. Output Bundles of Modules

Please provide the output bundles of the modules by running the scenario (or get from the scenario History tab), then click the white speech bubble on the top-right of each module and select “Download input/output bundles”.

Providing the input/output bundles will allow others to replicate what is going on in the scenario even if they do not use the external service.

Following these steps will allow others to assist you here. Thanks!

Thanks, please find the documents attached.

  1. Blueprint of the simplified scenario that holds the issue I am trying to resolve (there were still a lot of modules before and after but for the sake of the issue, they are of no relevance, hence I took them out). Additionally, I had to take out the API key for the HTTP module. This will not run now anymore, however the issue is the input into that module rather than the output.

  2. I have attached the two output txt files of the HTTP module. All other outputs can be directly created as all the variables are just set in the scenario.

For clarification, the main issue is that I need the input variable of the HTTP module (6) to be one of the set variables (module 2) and which of these should be dependent on the repeater run (module 3).

THanks a lot!

output bundle 2.txt (2.6 KB)
output bundle 1.txt (9.4 KB)
blueprint (2).json (29.8 KB)

You’ll need to create the runs as an array,

Screenshot_2024-08-12_220836

Iterate the runs array,

Screenshot_2024-08-12_220842

And use the Iterator’s current value in the HTTP module.

blueprint.json (27.3 KB)

Hope this helps! Let me know if there are any further questions or issues.

@samliew

Thanks @samliew ! This helped in being able to call the values separately in the HTTP module, but is it also still possible to have them run ‘sequentially’?

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 :slight_smile:

Absolutely, but that’s a new question.

Thanks, posted the question with all context here: Call array variables sequentially (if no answer is found via first array entry)

Marked previous solution :slight_smile:

1 Like