Dot notation: Difference between revisions
Appearance
Created page with "When working with Woodford and many other content tools, you often need to exactly identify a field in an entity, or a certain property of an object. We're usi..." |
No edit summary |
||
| Line 7: | Line 7: | ||
: Use the syntax <code>object.property</code> to refer to a property of an object. For example, IsNew is a property of a Questionnaire object. | : Use the syntax <code>object.property</code> to refer to a property of an object. For example, IsNew is a property of a Questionnaire object. | ||
In addition to these simple notations involving two parts | In addition to these simple notations involving two parts, in some cases, you can chain more parts, all connected by dots. For example: | ||
<code>QuestionGroups.location.Question.rate-the-location_1.IsEnabled</code> | <code>QuestionGroups.location.Question.rate-the-location_1.IsEnabled</code> | ||
Revision as of 08:14, 16 March 2020
When working with Woodford and many other content tools, you often need to exactly identify a field in an entity, or a certain property of an object. We're using the dot notation to identify these. Here are some simple examples:
contact.name
- Use the syntax
entity.fieldto refer to a particular field of an entity. In this case, it's the name of our contacts.
Questionnaire.IsNew
- Use the syntax
object.propertyto refer to a property of an object. For example, IsNew is a property of a Questionnaire object.
In addition to these simple notations involving two parts, in some cases, you can chain more parts, all connected by dots. For example:
QuestionGroups.location.Question.rate-the-location_1.IsEnabled
- This might look intimidating, but in fact, this variable simply allows you to control whether the question about rating from the question group called "location" is enabled in your questionnaire.