Roll20 uses cookies to improve your experience on our site. Cookies enable you to enjoy certain features, social sharing functionality, and tailor message and display ads to your interests on our site and others. They also help us understand how our site is being used. By continuing to use our site, you consent to our use of cookies. Update your cookie preferences .
Create a free account

@{target|token_id} inside a query


Edited 1634262409
Hello, I have a chat button sending the following message when pushed: !myAPI ?{Query|A1, valA1|A2, valA2} And I want to add a @{target|token_id} inside valA2. I think I am doing the character replacement correctly but the target window is not prompting, is the following code correct? !myAPI ?{Query|A1, valA1|A2, @{target|token_id} }

Edited 1634272280
The Aaron
Forum Champion
API Scripter
That's not going to work. You're encoding the @{target|...} correctly, but that will just pass the encoded version along as the argument to the API.  You really have only two options: Do not encode and continue to use a Roll Query but accept that you'll be asked to target even when you don't need it.  Encode and switch to using API buttons for A1 and A2.  In the second case, the pressing of the A2 button would cause the encoded part to be decoded and prompt for a target.  
I see, thank you for your kind reply, I will use two buttons instead.