Permalink
Fetching contributors…
Cannot retrieve contributors at this time
46 lines (44 sloc) 984 Bytes
metadata:
title: Variables as JSON
short title: JSON variables
documentation: "https://docassemble.org/docs/functions.html#variables_as_json"
example start: 1
example end: 3
---
mandatory: True
code: |
multi_user = True
---
event: query_variables
code: |
variables_as_json()
---
mandatory: True
question: |
You currently have
${ nice_number(number_of_pieces) }
${ noun_plural('piece', number_of_pieces) }
of
${ noun_singular(favorite_fruit) }.
subquestion: |
Use
[this link](${ interview_url_action('query_variables') })
to query the information from
another application.
You can also change the
[fruit](${ url_action('favorite_fruit') })
and the
[number of pieces](${ url_action('number_of_pieces') }).
---
question: |
What is your favorite fruit?
fields:
- Fruit: favorite_fruit
---
question: |
How many pieces of ${ noun_singular(favorite_fruit) }
do you have?
fields:
- Pieces: number_of_pieces
datatype: integer
min: 0