How to pass an instance variable captured in JavaScript to query activity | Community
Skip to main content
bhaskarc1289447
Level 3
Mar 31, 2022 2:43 PM UTC
Solved

How to pass an instance variable captured in JavaScript to query activity

Hi 

 

I have an variable and i want to pass it to a query. For my variable instance.vars.myVariable, i am using $(instance/vars/myVariable) but its not workingi n the query. I also tried assigning vars.myVariable and use $(vars/myVariable) in query and again that is not working. If we use $([instance/vars/myVariable ]) it shows error.

Kindly help

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
_Manoj_Kumar_
_Manoj_Kumar_Accepted solution
New Participant
Mar 31, 2022 2:45 PM UTC

Hello @bhaskarc1289447 

 

The correct syntax is

$(instance/vars/@myVariable)

 

     Manoj     Find me on LinkedIn

4 replies

_Manoj_Kumar_
_Manoj_Kumar_Accepted solution
New Participant
Mar 31, 2022 2:45 PM UTC

Hello @bhaskarc1289447 

 

The correct syntax is

$(instance/vars/@myVariable)

 

Translate
     Manoj     Find me on LinkedIn
bhaskarc1289447
Level 3
Apr 5, 2022 9:24 PM UTC

Thank you @_manoj_kumar_ 

 

In myVariable, it has comma separated data. Example:  apple,orange,banana

 

when I use the query activity

 

fruits ---> is included in --> $(instance/vars/@myVariable), I am getting zero results. 

 

is it possible to use 'is included in' with $(instance/vars/@myVariable) in query activity or there is any alternate way to do that as myVariable will always have more that 2-3 data.

 

also there are multiple query conditions together. For example :

       fruits ---> is included in --> $(instance/vars/@myVariable)

and vegetables ---> is included in --> $(instance/vars/@myVariable2)

 

please help

Translate
_Manoj_Kumar_
New Participant
Apr 6, 2022 4:56 AM UTC

Hello @bhaskarc1289447 

 

Yes, it won't work with is included in operator.

 

Can you explain your use case? May be there is another way to do it.

 

Translate
     Manoj     Find me on LinkedIn