Referencing Form Questions and Case Properties with Hashtags
The below is a primer on how to reference form questions and case properties using the hashtag shortcut.
When in doubt, you can always drag and drop questions or case properties from the windows on the left of the form builder. But if you want to go for speed, here's how the hashtags work
Note: If you created your project before August 2016, you may need to contact support@dimagi.com to receive an upgrade before using these references.
Let the Autocomplete Dropdown Help You Out
You don't have to know the exact format of the hashtag reference in order to use hashtags. Just enter # and start typing to narrow down results. An autocomplete dropdown will appear that displays the best matches to what you've typed.
Autocomplete finds matches by case property name, question ID, and question text.
Reference Form Questions
References to form questions always start with #form. They follow the format:
#form/question_id
Let's say I want to reference the question with the id "favorite_color". The reference would be:
#form/favorite_color
Reference Case Properties
References to case properties always start with #case. They follow the format:
#case/case_property_name
Let's say I want to reference the case property "case_name". The reference would be:
NOTE: If your app has multiple case types, this reference can only access case properties in the case type defined in your form's module.
Child Cases
If your current module's case type is a child case, you can also reference case properties of the parent case. References to the parent case follow the format:
Let's say I want to reference the case property "case_name" of my parent case. The reference would be:
It is also possible to reference your parent's parent. For example, if you have three modules: household, family, baby, where "family" is a child case of "household", and "baby" is a child case of "family". In the baby module, you can reference the name of the household (my "grandparent" case) using the following format:
Let's say I'm in a form in the "baby" module, and I want to reference the name of the household. The reference would be: