Dynamic variable names

I am trying to create dynamic variable.

  1. I am able to set the variable.

  2. I am able to get the variable value

But when I want to access the variable, I am not able to use it in filter

image

Is is possible to reference dynamic variable, if I know the 2. id? Something lik {{33.xyz_{{2.id}}}}?

Try using https://www.make.com/en/help/functions/variables#system-variables-1529751

This might do the trick.

1 Like

Hi,

I do not think it does. I need to create 10 unique named variables (RN using Set/Get Variable) and later use them in the filter.

I know the names, but referencing dynamic variable in the filter from Get Variable is not possible with my knowledge.

Hi @iturnlokkdm, I just made an example based on your comment, and I can see that I am getting the data correctly.

Can you confirm that it is the same case as looking to perform?



1 Like

Hi, I am able to get the value from the Get variable module.


In the example you have created, after step Get a variable, create another module.

Between the new module at the end create a filter, which will filter only values, which are greater or equal than 1.0 (using get variable from previous step and the iterator variable i).


When I used your example, In the filter I was able only to reference {{4.var_1}} and {{4.var_2}} but not with dynamic name in the current iteration. (eg variable i - {{4.var_{{1.i}}}})

Hi @iturnlokkdm ,

It sounds like you’re trying to reference a dynamic variable in a filter and are having trouble accessing it. Based on what you’ve shared, it doesn’t seem possible to reference a dynamic variable in the way you’ve described. However, one solution could be to add an extra root around your data and use the get() function to dynamically fetch the key you need. I’ve created a quick demo to show you what I mean. Using the test data in the screenshot, I added a repeater and only fetched the item according to the counter of the repeater. The formula used is: {{get(1.root; "item" + toString(3.i))}} This gave me the result I expected.

I attached the blueprint so you can also import it and check at your side what I exactly mean.

blueprint (56).json (5.1 KB)

I hope this answers your question.

Glenn - Callinetic

2 Likes