About this article
Datasources[] is a function that returns a row of a data source. It is possible to get data from a data source by Name. This article will explain the binding syntax and show examples how this can be configured in the Dynamics Designer.
Pre-requisites
|
Syntax
Syntax | {{DataSources.DataSourceName[NameValueToLookUp].ColumnName}} |
The 'NameValueToLookUp' can be plain text or a form field. Using a form field you can use it as a variable, so the output depends on the input of the user.
The function can be used in the Binding field on the Element
tab in the Dynamics Designer:
Examples
In the examples below these data sources are used. The column Country of the Offices data source is a reference to the column Name of the Countries data source:
|
Example 1
Plain text: Get PostalCode from the row that contains the name "Office Eindhoven".
|
Binding |
{{DataSources.Offices["Office Eindhoven"].PostalCode}} |
Input | n/a |
Output | 5611 ZB |
Example 2
ComboBox: Get PostalCode from the row that contains the value of the form field {{Form.OfficeName}}.
Binding |
{{DataSources.Offices[Form.OfficeName].PostalCode}} |
Input | Office Copenhagen |
Output | 1403 |
Example 3
Dropdown: Get PostalCode from the row that contains the value of the form field {{Form.OfficeName}}.
|
Binding |
{{DataSources.Offices[Form.OfficeName.Name].PostalCode}} |
Input | Office New York |
Output | 10007 |
Example 4
ComboBox, nested: Get Country from the row that contains the value of the form field {{Form.OfficeName}}.
|
Binding |
{{DataSources.Offices[Form.OfficeName].Country.Name}} |
Input | Office Berlin |
Output | Germany |
Example 5
Get multiple fields from the row that contains the value of the form field {{Form.OfficeName}}.
Binding |
Location Templafy {{DataSources.Offices[Form.OfficeName].City}}: {{DataSources.Offices[Form.OfficeName].Address}}, {{DataSources.Offices[Form.OfficeName].PostalCode}}, {{DataSources.Offices[Form.OfficeName].City}}, {{DataSources.Offices[Form.OfficeName].Country.Name}} |
Input | Office Sydney |
Output | Location Templafy Sydney: 151 Clarence Street, NSW 2000, Sydney, Australia |
|
Example 6
For insertion of an image
Binding |
{{DataSources.DataSourceName["ImageName"].DataSourceColumnName}} |
Comments
0 comments
Article is closed for comments.