How to store value in a workflow

Hi

I need to understand how to store information in a variable that I can reuse many times in a workflow.
For example, I get an access token after a call to a webservice.
Next, I get items from the webservice (I need to give the access token to the webservice).
Finally, I need to iterate for each item ID in order to get details by a new call of the webservice (again, I need to give the access token and the ID of the item).

For the second call I can use the first value of the column just after the fist call.
But for the etape 3, I have to use first value of the column for give the item ID, but I have no possibility to give the access token.

Thank you for your help.

Hi!

I think you have two options here:

  1. Propagate the 'accessToken' column to all actions that need it. This would involve merging the accessToken table with the one on stage 3 in your example.
  2. The more EasyMorph-idiomatic way is to separate the calls that need the token into Modules and then pass the accessToken to these modules as a module parameter using Call action. This would be the cleaner option, too

There is also the SharedMemory action, but I don't think it's a good fit here.

Thank you for your answer.

Have also find the solution to use modules.
When I have two values to propagate to modules, I have used the peek component in order to create a table with one column per "variable", so I can affect this columns in parameters.

The feature of variables could be more simplest than this solution.

In EasyMorph, columns are effectively variables. You can create, modify, and append/merge them at any point.

EasyMorph doesn't have mutable variables deliberately, as parts of workflows are executed in parallel, non-linearly. Mutable variables would make understanding workflow logic more difficult.

In your particular case, you may not need to manage the access token at all. The "Web location" connector used in the first "Web request" action has various authentication modes, including OAuth - a typical authentication mode with an access token. If your webservice also uses OAuth, then you can configure the "Web location" connector for the OAuth mode, and it will obtain, refresh, and use the access token in all "Web request" actions automatically.