This is the documentation for ConfiForms Server/Data Center app
However, this might also work for ConfiForms cloud and in most cases it does. But please see this page to understand the differences between server and cloud versions of the ConfiForms app.
In this tutorial we will create a data entry form with dependent fields
It is important to remember field names, as ConfiForms Field Definition rules macro expects you to know it
Here is how the form looks in the view mode
Important note: on the screenshot above you see only 4 fields initially. This is because of the rules defined. See below.
Let's see what is in rules
Third rule also observes the value chosen in the same radio button
but hides the field 'f3' where second option is selected in the radio group control or when nothing is selected
The storage format for the form is listed below
<ac:structured-macro ac:name="confiform"> <ac:parameter ac:name="formName">f</ac:parameter> <ac:rich-text-body> <p> <ac:structured-macro ac:name="confiform-entry-register"> <ac:parameter ac:name="atlassian-macro-output-type">INLINE</ac:parameter> <ac:rich-text-body> <p> </p> </ac:rich-text-body> </ac:structured-macro> <ac:structured-macro ac:name="confiform-field-definition"> <ac:parameter ac:name="type">text</ac:parameter> <ac:parameter ac:name="fieldName">f1</ac:parameter> <ac:parameter ac:name="fieldLabel">F1</ac:parameter> </ac:structured-macro> </p> <p> <ac:structured-macro ac:name="confiform-field-definition"> <ac:parameter ac:name="values">false[1=one|2=two|]</ac:parameter> <ac:parameter ac:name="type">select</ac:parameter> <ac:parameter ac:name="fieldName">d1</ac:parameter> <ac:parameter ac:name="fieldLabel">Dropdown</ac:parameter> </ac:structured-macro> </p> <p> <ac:structured-macro ac:name="confiform-field-definition"> <ac:parameter ac:name="type">text</ac:parameter> <ac:parameter ac:name="fieldName">f2</ac:parameter> <ac:parameter ac:name="fieldLabel">F2</ac:parameter> </ac:structured-macro> </p> <p> <ac:structured-macro ac:name="confiform-field-definition"> <ac:parameter ac:name="values">false[val1=Value 1|val2=Value 2|]</ac:parameter> <ac:parameter ac:name="type">radio_group</ac:parameter> <ac:parameter ac:name="fieldName">r1</ac:parameter> <ac:parameter ac:name="fieldLabel">Radio 1</ac:parameter> </ac:structured-macro> </p> <p> <ac:structured-macro ac:name="confiform-field-definition"> <ac:parameter ac:name="type">text</ac:parameter> <ac:parameter ac:name="fieldName">f3</ac:parameter> <ac:parameter ac:name="fieldLabel">Field 3</ac:parameter> </ac:structured-macro> </p> <p> <ac:structured-macro ac:name="confiform-field-definition-rules"> <ac:parameter ac:name="values">d1=2&f2=value is set by field 1</ac:parameter> <ac:parameter ac:name="condition">f1:testme</ac:parameter> <ac:parameter ac:name="action">Set value</ac:parameter> <ac:parameter ac:name="actionFieldName">f1</ac:parameter> </ac:structured-macro> </p> <p> <ac:structured-macro ac:name="confiform-field-definition-rules"> <ac:parameter ac:name="condition">r1:val1</ac:parameter> <ac:parameter ac:name="action">Show field</ac:parameter> <ac:parameter ac:name="fieldName">f3</ac:parameter> <ac:parameter ac:name="actionFieldName">r1</ac:parameter> </ac:structured-macro> </p> <p> <ac:structured-macro ac:name="confiform-field-definition-rules"> <ac:parameter ac:name="condition">r1:val2 OR r1:</ac:parameter> <ac:parameter ac:name="action">Hide field</ac:parameter> <ac:parameter ac:name="fieldName">f3</ac:parameter> <ac:parameter ac:name="actionFieldName">r1</ac:parameter> </ac:structured-macro> </p> <p> </p> </ac:rich-text-body> </ac:structured-macro>
Check out the video how the form looks like and behaves based on the values selected