Confiforms - How to create dependent smart dropdowns where all fields have values in another form?

Jonathan Knollmeyer May 24, 2018

I have a table populated with a Confiform which has Domains and Programs (one to many).

 

On a new form, I want to select a Domain from a dropdown populated from this table.

Based on the Domain value selected, I want a second dropdown to contain the respective Programs for said domain. 

The values should update dynamically, based on the Domain selection.

I can get this to work, however, the values in each dropdown are not distinct. The values get repeated, having the same number of rows in the table. (The same Domain/Program value will show 10 times, if there are 10 rows for that Domain/Program).

 

Here is my source code:


<ac:structured-macro ac:name="confiform">
<ac:parameter ac:name="formName">usingchoices</ac:parameter>
<ac:rich-text-body>
<p>
<ac:structured-macro ac:name="confiform-entry-register">
<ac:parameter ac:name="embedded">true</ac:parameter>
<ac:parameter ac:name="atlassian-macro-output-type">INLINE</ac:parameter>
<ac:rich-text-body>
<p> </p>
</ac:rich-text-body>
</ac:structured-macro> </p>
<p>
<ac:structured-macro ac:name="confiform-field-definition">
<ac:parameter ac:name="fieldName">mychoice1</ac:parameter>
<ac:parameter ac:name="fieldLabel">My choice 1</ac:parameter>
<ac:parameter ac:name="values">[277274429|esf|domain.name|true||]</ac:parameter>
<ac:parameter ac:name="type">smartselect2</ac:parameter>
</ac:structured-macro>
</p>
<p>
<ac:structured-macro ac:name="confiform-field-definition">
<ac:parameter ac:name="fieldName">mychoice2</ac:parameter>
<ac:parameter ac:name="fieldLabel">My choice 2</ac:parameter>
<ac:parameter ac:name="values">[277274429|esf|program.name|true||]</ac:parameter>
<ac:parameter ac:name="type">smartselect2</ac:parameter>
</ac:structured-macro>
</p>
<p>
<ac:structured-macro ac:name="confiform-field-definition-rules">
<ac:parameter ac:name="fieldName">mychoice2</ac:parameter>
<ac:parameter ac:name="values">domain:[entry.mychoice1.domain]</ac:parameter>
<ac:parameter ac:name="action">Apply Filter on a field</ac:parameter>
<ac:parameter ac:name="actionFieldName">mychoice1</ac:parameter>
</ac:structured-macro>
</p>
</ac:rich-text-body>
</ac:structured-macro>

1 answer

0 votes
Alex Medved _ConfiForms_
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
June 28, 2018

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events