Set Variable in Iterator

I am having trouble setting the output of one iteration as a variable, that is used by the next iteration.

I start with a Google Sheet. It has 3 parts of a social media post thread.

In module 8, I set an initial ID value [raw name “post_ID”].

Module 8 sets the initial value of post_ID is “123”

image


Desired Behaviour

In each iteration, the HTTP module [Module 3] is posting to a social media site.

It is posting in reply to a specific, existing post on the social media site. In this case the pre-existing post has an ID of “123”.

Module 3 is the HTP module. It uses the “post_ID” variable as follows

image

When the first iteration completes, the reply post is successful. That successful reply has a new id of “456” which is returned as output of Module 3.

I want the second iteration to reply to ID “456” [creating a thread of my replies]

So I want the output of each iteration to return an ID, and for that ID to be used as input to the next iteration, so the new post replies to the post made by the previous iteration.


I try to update the post_ID variable by using Module 9.

[Note: “10.data.id” is parsed (nested) JSON output from module 3]

image


The problem The HTTP module [Module 3] keeps using the initial value of “123” as an input.

After each iteration, the set variable module on the far right [Module 9] appears to be updating the post_ID variable.

but that is not getting used by module 3 in the next iteration

Any advice or help is appreciated. :slight_smile:

1 Like

You’ll need to use a “Get Variable” module immediately after the Iterator module, to get the updated variable value at the beginning of each iteration “loop”.

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

@samliew


P.S.: Did you know, the concepts of about 70% of questions asked on this forum are already covered in the Make Academy. Investing some effort into it will save you lots of time and frustration using Make later!

Thanks. I think that helped. I basically had to rebiold the whole scenario. I used th esme settings and it worked. Some sort of bug

1 Like