Table of Contents

How to conditionalize user inputs based on earlier user inputs

Summary

Some applications require forms where certain inputs depend on a previous input value.  

For example, users first choose one United States state from a drop-down list. Depending on the state choice, a follow up question appears. This question may require clicking a radio button, completing a text box, or another user interaction).

A pair of chained Dynamic Select controls won't work, as this approach does not support the wide range of possibilities for the second question and value.  

A straightforward approach is to ask the state question in a first flow action, then have the next flow action figure out the appropriate follow-up question.  But in some cases this doesn't look great, and a single-screen look is preferred. Is there a one-form approach?



 

Suggested Approach

Create a Rule-HTML-Property rule called something like PromptSelectRefresh by copying and saving the standard HTML Property rule promptSelect.

Update your copy with onChange=”javascript:reSubmit();” on the <select> elements. 

Then use your flow action to conditionalize the follow-up questions based on the .State property.

This approach uses rules rather than JavaScript functions) to build the associations, and still provides the preferred "single-screen" look.

Suggest Edit

Have a question? Get answers now.

Visit the Pega Support Community to ask questions, engage in discussions, and help others.