FormComponent

Brian Brown asked on August 22, 2022 20:19

I've created a few Form Components that read from a Custom Table.

I'm now trying to create a Form Component that reads from a Custom Table based on what was selected in a previous field. Example: I'm trying to create a EmailTo Form Component (just a textbox) that pulls an email address from a Custom Table (the custom table has a list of email addressed and states) based on what was selected in the state dropdownlist earlier in the form.

Any direction would be appreciated.

Recent Answers


Eugene Paden answered on August 22, 2022 20:30

Do you already have the code to retrieve content from the Custom Table?

The article Developing Form Components should be able to help you get started.

1 votesVote for this answer Mark as a Correct answer

Brian Brown answered on August 22, 2022 21:17

What's tripping me up is how do I pass the value selected in the form from the Custom Table (State) into the Form Component.

0 votesVote for this answer Mark as a Correct answer

Sean Wright answered on September 10, 2022 18:07

Currently, Form Components are designed to be used independently - they cannot pass state to each other. If you need to have the value of one form input impact what is displayed in another, I'd recommend combining those fields into a single Form Component and serializing the state into a string value. The example in the docs of a color selector Form Component is a good example of this approach.

That said, for the next Xperience refresh we will be getting a feature that allows Form Components to pass state to each other for conditional visibility and other logic.

1 votesVote for this answer Mark as a Correct answer

   Please, sign in to be able to submit a new answer.