There are various ways to read data from a data source into the form. By far the simplest option is to realise this via a calculation field. Another option is to read in data sources via Java Script.
We use the following data source as the basis for both examples:
Import data source via a calculation field
A selection element is required for this solution. The values of the data source are saved in this element so that the calculation fields can access them.
Drag a selection element into the workspace and select the corresponding data source as shown in the following screenshot. Please ensure that the "Render all attributes" option is activated!
To display the values of the data source in an element, drag a calculation field into the workspace. In the "Calculation" properties, you can now access the individual values of the data source via the selection element using the following command. Repeat this to access further values of the corresponding entry.
$('.NameDesAuswahlelements :selected').data(Spaltenindex)
Replace "NameDEsAuswahlelements" with the name of your selection element and "Spaltenindex" with the index of the data source column.
In our example, this would be the following command for the salutation:
$('.selAuswahlAusDatenquelle :selected').data('col1')
Please note that the column index to be specified is not identical to the column numbering of the data source. In our data source, for example, the Anrede is column 2, but the column index to be specified must always be "- 1". So: ID = col0, Anrede = col1, Vorname = col2 etc.
If you now open the form and select an entry in the selection element, the values are displayed in the corresponding calculation fields.
Auslesen der Daten direkt beim öffnen des Formular mittels Übergabeparameter
If, for example, you want the selection to be made directly when the form is opened and not via the selection element, you can realise this via a transfer parameter when the form is called up. To do this, simply hide the selection element (selAuswahlAusDatenquelle) and insert the name of the selection element with the corresponding value of the "Wert Spalte" when the form is called up. In our example, this is:
https://formexchange.formcycle.eu/formcycle/form/provide/1125?selAuswahlAusDatenquelle=5
(the 5 stands for the entry of the data source with the ID 5 (Max Mustermann))
Was this article helpful?
That’s Great!
Thank you for your feedback
Sorry! We couldn't be helpful
Thank you for your feedback
Feedback sent
We appreciate your effort and will try to fix the article