Forum Academy Marketplace Showcase Pricing Features

Multiplying a list of number by a constant in workflow

Hi All,

I need some help, pleaseee.

I need to multiply a list of numbers (prices) returned by an API by a constant (size) in a workflow and save the result to the database. Seem simple but I can’t seem to get this to work.

Does anyone know of a solution for this?

I tried Listshifter - doesn’t work in workflow.
I am playing around with the Transform List which should work but just can’t seem to figure it out to make it work.

Thanks in advance.

I am not sure what part is the issue.

If it is the constant you could consider placing a hidden group, make it of type “number”, place your constant there, name the group “constantX” and refer to it in expressions.

@cmarchan are you referring to the Transform List script above?
the output list from the plugin is incorrect. It only takes the first item in the list, multiplies it by the constant. It doesn’t iterate down the array for some reason.

Explore the “begin iterate” list shifter action and the “iterate” / “iteration complete” events, if I am not mistaken.

@cmarchan as mentioned, can not use Listshifter in workflow because there’s no guarantee that Listshifter would finish iteration by the time bubble execute the next step (which is to save the result ). So if Listshifter finished iterating then you get the right result, if it hasn’t finish iterating by the time the next step is executed then you get the wrong result.