Forum Academy Marketplace Showcase Pricing Features

Problem with instance.data.variable not working

Hello.

I’m really driving crazy with this problem.

My update has properties.xxx (from the element fields).
Everything ok.

I want to pass some variables to my element action, so I did this:

instance.data.source = properties.source;
instance.data.color = properties.getcolor;
console.log(instance.data.source);
console.log(instance.data.color);

result:
https://xx.com
#000FFF

Easy right?

Ok now in my element action code:

var source = instance.data.source;
var color = instance.data.color;

console.log(source);
console.log(color);

result:
undefined
undefined

What i’m missing ??

Are you passing between elements in the same plugin?

Or are you trying to pass data to/from a workflow action from an element action?

Something like that?

I do this ^^^^^ passing of data all the time

Hi @jared.gibb

Yes it’s in the same plugin. Same element (My plugin only has one element).

As said, im trying to pass data from update to element action.

But for some reason is not working…

It feels like the data aren’t getting where you think they should be. In update, keep the console log. Only after you see it fire in update, try to run your action and see the result. Remove all code except for the passing of data and logging to check if it’s there.

If that doesn’t work the issue would likely lie in the update code and something blocking those data from passing.

Did you get that sorted out?