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 .
×

Help with Query Tricks

I was looking in the forum, and I was trying to figure out how to set up my burn calculator for a Kineticist in the Pathfinder sheet. I have a nice macro that does most of it, but I want it to be able to change what populates the dropdowns based on the result from a query. I got pretty far with it. My dropdown options are filled using custom attributes. Here is the relevant portion of the macro: ! ?{Which blast?|@{customb6}} ?{Form Infusion?|@{customb1}} ?{Substance Infusion?|@{customb2}} ?{Internal Buffer? Max @{internalbuffer}|0} ?{Gather Power?|0|1|2|3} What I want is to have the substance infusion change from using just customb2 as its list to using either customb2 or customb5, based on the result from the Which blast? query. For reference, here are my relevant custom attributes: customb6 Air, customb2|Electric, customb5 customb2 None,0|Pushing(Air Blast only) 1,1 customb5 None,0 prefix @{ I have tried the trick I saw here , but I wasn't able to get anything other than  TypeError: Cannot read property 'substring' of undefined !?{Query|customb6} [[@{prefix}?{Query}}]] This didn't work. Can someone please give me a hand? 
I actually figured it out. Updated my query to the following:  ! ?{Which blast?|@{customb6}} ?{Form Infusion?|@{customb1}} ?{Internal Buffer? Max @{internalbuffer}|0} ?{Gather Power?|0|1|2|3} customb6 Air, @{customb3}|Electric, @{customb4} customb3 ?{Substance Infusion?|None,0|Pushing(Air Blast only) 1,1} customb4 ?{Substance Infusion?|None,0|None,0} It's not so nice to read/update, and it messes with the order that I wanted things done in, but it definitely works. 
1581711492
keithcurtis
Forum Champion
Marketplace Creator
API Scripter
With regards to the order bit, there's always this Stupid Trick : Query Ordering Without Affecting Functionality  - Ziechael
Problem is that trick doesn't work when you're dealing with nested queries. If you want the wrapping query to come first, then by necessity the query inside of it must come second if you don't want THAT one to be first.