Help with plugin

I’m not able to access an editor field in the code of an action of the plugin I’m developing

Here is my plugin code, it works perfectly, but I will add a new action, which is an action executed through a workflow, but I can’t get the value of the “element_id” field in the action code “move_back”

This is the field I’m referring to.

In the plugin code I can get the value of the field
Screenshot_161

In the action code, I can’t get the value, it returns “undefined” in the console

HELP

You cannot use element properties into action. You need to use action properties
You can however pass the element properties into instance.data and call it using instance in the action

2 Likes

Could you help me with a code example? I’m trying this way but it still doesn’t work.

What @Jici is telling you is this: In update, save properties.element_id to the instance.data object, for example:

instance.data.element_id = properties.element_id
const slider = document.querySelector('#' + instance.data.element_id)
// ... etc. Also, ugh jQuery. Why? 

Then in your action function, you now have access to that value, again as instance.data.element_id:

console.log('Element ID is: ', instance.data.element_id)

3 Likes