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

Hide Rolltemplate row when property was send

1676321127
.Hell
Sheet Author
Hi everyone, I want to hide a row in my rolltemplate only when a specific property was added to the roll-template command. This should show the row &{template:roll}{{name=@{character_name}}}{{roll=[[1d20]]}} and this should not &{template:roll}{{name=@{character_name}}}{{roll=[[1d20]]}}{{heat=[[1d20]]}}
1676337525

Edited 1676337629
GiGs
Pro
Sheet Author
API Scripter
I don't know if it's possible to do that. But there's a property that checks if a property exists, you could try the not operator with that (so checking it doesnt exist): {{#^heat}} whatever is supposed to apear if property absent {{/^heat}} Report back if it works!
1676337719
GiGs
Pro
Sheet Author
API Scripter
If the above doesnt work, you'll have to include the heat in every roll, but set it tio value you cannot generate on the roll, like &{template:roll}{{name=@{character_name}}}{{roll=[[1d20]]}}{{heat=[[0]]}} Then use rollTotal to check for that value and show the line then.
1676362074
.Hell
Sheet Author
Your first proposal unfortunately does not work. It never shows if I do it like that
1676404073
Scott C.
Forum Champion
Sheet Author
API Scripter
Compendium Curator
Can you share your code .Hell? GiGs' first suggestion should have worked. I do this frequently in my sheets.
1676444256

Edited 1676444910
.Hell
Sheet Author
I rebuild it according to the second suggestion. So the current code is <rolltemplate class="sheet-rolltemplate-roll">     <table>         <tr>             <th>                 {{name}} rolls             </th>         </tr>         <tr>             <td>                 <div class="sheet-rolltemplate-spacer"></div>             </td>         </tr>         <tr>             <td>                 {{roll}}             </td>         </tr>         {{#heat}}         <tr>             <td>                 <div class="sheet-rolltemplate-spacer"></div>             </td>         </tr>         <tr>             <td>                 Heat Check: {{heat}} vs {{heatroll}}             </td>         </tr>         {{/heat}}     </table>     {{#mech}}     <div class="sheet-rolltemplate-button-row">         {{#rollTotal() heatroll 0}}         <div class="sheet-rolltemplate-button">             [Push](~{{name}}|reactPush)         </div>         {{/rollTotal() heatroll 0}}         {{#^rollGreater() heatroll heat}}         <div class="sheet-rolltemplate-button">             [Reactor Overload](~{{name}}|reactOverload)         </div>         {{/^rollGreater() heatroll heat}}     </div>     {{/mech}} </rolltemplate> and &{template:roll}{{name=@{character_name}}}{{roll=[[1d20]]}}{{mech=1}}{{heatroll=[[0]]}} As is shown in the template the positive case works as extended (heat) but the negative case (heatroll) does not work
1676509723
GiGs
Pro
Sheet Author
API Scripter
Scott C. said: Can you share your code .Hell? GiGs' first suggestion should have worked. I do this frequently in my sheets. That's handy to know!