i start a workflow from a button.
in this workflow i need some of the informations of the thisinstance - but not from the buttom the workflow starts, but from another element (div).
how can i get that?
i can give the element an id but id.thisinstance didnt work…
any ideas?
thanks for help.
PS: The AI gives this (but i dont understand, what to to)
// Get the instance of the element with ID hpa2401
const outputHPPInstance = context.workflow[‘hpa2401’];
// Return the instance information
return outputHPPInstance;
but this is: undefiend…
To access the thisInstance information of the element with the ID hpa2401 named “> Output HPP 100%”, you can use the following approach in WeWeb:
Identify the Element: Ensure that the element with ID hpa2401 is correctly referenced in your code or workflow.
Access thisInstance: You can access the thisInstance properties by using the context of the element. For example:
javascript
Copy code
const outputHPPInstance = context.workflow[‘hpa2401’];
Retrieve Properties: You can then access specific properties of the thisInstance as needed, such as:
javascript
Copy code
const height = outputHPPInstance.height;
const width = outputHPPInstance.width;
Make sure to replace the property names with the actual properties you want to access from the thisInstance.
from that i get a lot of informations about that objekt.
i need especially the offsetHeight in a workflow.
the problem is, that the workflow starts from an other element (button). so if i use the workflowstep “return a value” i get the informations of that element (button).
so i look for a possibility to get the “thisInstance”-Informations from an other element. i read something from context.thisInstance but i dont understand, what that mean.
how can i tell the “return a value”-formular, from what element it should take the “thisInstance”-Information?
is there the posiibility to do that?
Maybe there’s a way where as a first step you save the this.instance value inside a variable and then on another workflow you can call this variable directly ? (instead of trying to access the “thisinstance” from another place)
Yes, that was a possibility. but unfortunately the value ist not fix (because of that i need to get it at that moment, when i start the workflow).
the problem is the height auto value with the transitions.
i want to close an open div (and it go to height = 0). so the div is instantly disappearing, and the transition of the opacity is not to see.
on opening the div the transition works (because the height become from 0 to auto, so the div is instantly there, and the opacity can come with the transition. but on closing it dont work, so i want to give the div the height in pixel, that it can role away to height = 0.
in this moment i think: perhaps i need a thrid state. first i change only the opaciti give a delay in the workflow and then change the height to 0.
Hi Guillenius,
thank you for your reply.
i can set an id as attribut. but how can i adress this id then in the formular?
with “myid.thisInstance” it didnt work…
stefan