Prefilling e-Form
Learn how to pass data to e-Form and pre-fill components with data.
Last updated
Was this helpful?
Learn how to pass data to e-Form and pre-fill components with data.
Last updated
Was this helpful?
Pass values to OZFormParam parameters in e-Form.
Use viewer options connection.pcount and connection.args
Open customer.ozr
and save it as customer-formparam.ozr
.
Add an OZFormParam name.
Bind the parameter name with the TextBox name.
Open customer.html
and save it as customer-formparam.html
.
Pass values for the parameter name and smoker as below:
Send a JSON data string to your e-Form with the viewer option connection.inputjson.
All item values in JSON will be put into the corresponding components in the e-Form automatically.✨
Open customer.ozr
.
Set AllowSending (of input components that you don't want to use) to False.
Preview
Enter field values as you prefer.
Right-click the Hamberger icon on the top-right of the Viewer.
Select Copy input data (json) from the menu list.
Save the copied JSON string as jsondata.txt
customer-inputjson.html
Open customer.html
and save it as customer-inputjson.html
.
Add a variable data and assign its value from the clipboard.
The JSON string must be wrapped with single quotes.
Assign the variable data to the connection.inputjson option.
Get the value of smoker field from the JSON string.
No need to add a parameter to get the JSON string from HTML.
Show if country_other got a value.
Item names in JSON string must be the same as the Name or FormID of corresponding components in the e-Form.
Open customer.ozr
and save it as customer-jsondataset.ozr
.
Add a JSON Dataset customer. (refer to the video clip above)
Assign dataset fields to input components.
Add a form parameter jsondata.
Set the Runtime Dataset of the dataset customer to the Parameter(data).
customer-jsondataset.html
Open customer.html
and save it as customer-jsondataset.html
.
Send a JSON string to the parameter jsondata
Tick male or female of the Gender using customer.gender.
Tick Yes or No of the Smoker using customer.smoker.
Show the bmi_band using customer.gender instead of OZFormParam.smoker.
customer-jsondataset-url.ozr
Set the Runtime Dataset of the dataset customer to the Parameter(URL).
Prefill data in OZR from the database using ODI.
Create customer-odidataset.odi
Import customer-odidataset.odi into customer-odidataset.ozr
customer-odidataset.ozr
customer-odidataset.odi
Prepare the URL of the .