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..." |
Marek Rodak (talk | contribs) No edit summary |
||
| (One intermediate revision by one other user not shown) | |||
| 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> | ||
: 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. | : 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. | ||
{{Note| One important thing to remember is that in most cases, you don't have to type these in! Instead, you build these by clicking and selecting from drop-down lists. Resco tools will guide you and allow only those elements that make sense in a particular position.<br>[[File:Dot notation.png|600px]]}} | {{Note| One important thing to remember is that in most cases, you don't have to type these in! Instead, you build these by clicking and selecting from drop-down lists. Resco tools will guide you and allow only those elements that make sense in a particular position.<br>[[File:Dot notation.png|alt=Dot notation example|600px]]}} | ||
[[Category:Support]] | [[Category:Support]] | ||
Latest revision as of 11:15, 15 November 2023
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.