Problem with iterating a module with Web Request

I have this working but cannot quite figure out how to go from my SQL Query in Main, to calling a module that has this post to Teams in it. I’ve tried the iterate action to iterate thru the values in he table but it does not allow me to pass the values from the table queried into the parameters for the module that has the Teams Post in it. I looked up the iteration examples and can’t see how they apply properly to this.

The “Iterate” action can assign values in the table to the parameters of the called module. The red rectangle in the image below shows the place in the action settings where you can assign column values to parameters.

See also the tutorial article on iterations: EasyMorph | Iterations

image

thank you - I have looked at that and tried and have the columns from the table assigned to parameters I created for the Teams HTTP Post but they all come thru as empty.

image

Action settings look correct. Everything should work if you run the “Main” module. However, if you left parameter values empty in the parameter definitions of the “PostToTeams” module, AND ran the “PostToTeams” module, then the Teams message would be empty.

During iterations, the parameters of the iterated module get overwritten by values from the respective columns assigned by the “Iterate” action. But that happens under the hood, during iterations. The default parameter values in the module remain unchanged.

If that explanation doesn’t help, feel free to send the project to me in a direct message on this forum. I’ll take look at it.

Make sure you run the “Main” module by pressing the “Run all actions” button.
image

Otherwise, auto-run won’t automatically run the “Iterate” action, because the iterated module (“PostToTeams”) has an action with side effects. An action with side effects is any any action that modifies or affects external data or systems. The “Web request” action that sends a POST request is considered a side effect action and therefore is not executed automatically.

So do the following:

  1. Go to the Main module.
  2. Press the “Run all actions” button (can be seen in the screenshot above).

That will force the “Web request” action to be executed in the iterated module, and the iteration will finish successfully.