Hi there,
I am trying to create the logic so I can copy the text inside the container(to my mobile phone keyboard) whenever I tap any part of the container.
So, what I did is :
1- In the container Event property I chose onclick
2- Created a new client action to be the handler
3- In the client action, I created a local var "TextToCopy" of type text
4- I dragged an assign and typed TextToCopy (variable)= "ContainerName.TextName"(Value)
5- Then dragged a JS node :
window.navigator.clipboard.writeText(TextToCopy);
when I test it, the error that appears says "TextToCopy " is not defined ( I tried switching the local var position to belong to the screen and not the client action(handler) but the same error persists.
Any way to solve this or any way to redo everything with a simpler solution.
Best regards,
Azhar
Since I also needed to copy only the number from the whole container I used this code and it works perfectly
Hi @Azhar Bondi ,
did you pass the textToCopy variable to the JS node as an input parameter?
Like this:I just tried it and it works for me. I think your mistake might be that you are trying to use the textToCopy variable directly instead of passing it as input parameter to the JS node. Keep in mind that inside a JS node you are in a specific scope and you need to pass your variables to this scope, otherwise they won't be recognized.
Cheers,
Paulo