formio / formio.js

JavaScript powered Forms with JSON Form Builder

Home Page:https://formio.github.io/formio.js

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Populating form with selected resource submission data.

hermescati opened this issue · comments

Hello,

I wanted some help with using resource fields outside the resource. For more context: I have created a resource called Product that has the following fields - title, description, and price. In a new form, I have added a select component that references all the Product submissions.

What I want to achieve is to populate an HTML element or text field in this form, with the resource submission data. Ex: The select component displays the product titles, but in a separate component I want to see the description and price of the selected product.

I believe I was able to accomplish by setting the value property in the select dropdown to "Entire Object" and then proceeding to set the item template to only display the title of the project. This gives me access to the entire object while only displaying the title.
image
Then in my text field I just added a calculated value based on the value of what was selected in the dropdown.
image

I hope that's what you were looking for!
image