ConfiForms - Set default values on a Checkbox Group

Matthew Johnson
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
March 14, 2022

I've created a Checkbox Group field, 'myPony' with two entries:

 

id: one

label: One Pony

 

id: two

label: Two Ponies

 

Now I want to select some defaults using a rule for field definition. I'd like to accomplish the following scenarios:

  • 'one' by default
  • all options by default

 

How do I achieve this?

 

Thank you very much!

2 answers

1 accepted

0 votes
Answer accepted
Alex Medved _ConfiForms_
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
March 14, 2022

Hi @Matthew Johnson 

Welcome to this community

You can set defaults via ConfiForms Registrations Control (FormView) macro, setting the parameter to override defaults or via ConfiForms Field Definition Rules macros

myPony=one

or 

myPony=one,two

Demo:

http://recordit.co/lz8xsq3kzT

Storage format for the reference:

<ac:structured-macro ac:macro-id="2759a131-5150-44f8-b82a-9d7d1831b6b2" ac:name="confiform" ac:schema-version="1">
<ac:parameter ac:name="formName">f</ac:parameter>
<ac:rich-text-body>
<ac:structured-macro ac:macro-id="ae6b68cb-5310-4876-a004-516fa837d581" ac:name="confiform-entry-register" ac:schema-version="1">
<ac:rich-text-body>
<p>
<br/>
</p>
</ac:rich-text-body>
</ac:structured-macro>
<p>
<ac:structured-macro ac:macro-id="c3901c30-a42d-4ffd-9783-7abdd7efd53d" ac:name="confiform-field-definition" ac:schema-version="1">
<ac:parameter ac:name="fieldName">myPony</ac:parameter>
<ac:parameter ac:name="fieldLabel">myPony</ac:parameter>
<ac:parameter ac:name="values">false[one=One Pony|two=Two Ponies|]</ac:parameter>
<ac:parameter ac:name="type">checkbox_group</ac:parameter>
</ac:structured-macro>
</p>
<p>
<br/>
</p>
<p>
<br/>
</p>
<p>
<br/>
</p>
<p>
<ac:structured-macro ac:macro-id="cb9f4050-cc12-4371-83ca-f6ececb6ee3a" ac:name="confiform-field-definition" ac:schema-version="1">
<ac:parameter ac:name="fieldName">setone</ac:parameter>
<ac:parameter ac:name="fieldLabel">Set one</ac:parameter>
<ac:parameter ac:name="type">checkbox</ac:parameter>
</ac:structured-macro>
</p>
<p>
<ac:structured-macro ac:macro-id="14f43c78-60e4-4bc9-9644-d5e5557e786b" ac:name="confiform-field-definition" ac:schema-version="1">
<ac:parameter ac:name="fieldName">setmany</ac:parameter>
<ac:parameter ac:name="fieldLabel">Set many</ac:parameter>
<ac:parameter ac:name="type">checkbox</ac:parameter>
</ac:structured-macro>
</p>
<p>
<ac:structured-macro ac:macro-id="a3de4f24-b67d-4455-8db5-b5b8ae02d294" ac:name="confiform-field-definition-rules" ac:schema-version="1">
<ac:parameter ac:name="condition">setone:true</ac:parameter>
<ac:parameter ac:name="values">myPony=one</ac:parameter>
<ac:parameter ac:name="action">Set value</ac:parameter>
<ac:parameter ac:name="actionFieldName">setone</ac:parameter>
</ac:structured-macro>
</p>
<p>
<ac:structured-macro ac:macro-id="9843cb60-1a05-4528-8c8a-516704295a3f" ac:name="confiform-field-definition-rules" ac:schema-version="1">
<ac:parameter ac:name="condition">setmany:true</ac:parameter>
<ac:parameter ac:name="values">myPony=one,two</ac:parameter>
<ac:parameter ac:name="action">Set value</ac:parameter>
<ac:parameter ac:name="actionFieldName">setmany</ac:parameter>
</ac:structured-macro>
</p>
<p>
<br/>
</p>
</ac:rich-text-body>
</ac:structured-macro>
<p>
<br/>
</p>
<p>via Registrations Control</p>
<ac:structured-macro ac:macro-id="7d592a6a-1606-4b62-9dd9-d4d7d507a455" ac:name="confiform-entry-register" ac:schema-version="1">
<ac:parameter ac:name="formName">f</ac:parameter>
<ac:parameter ac:name="presetValues">myPony=one,two</ac:parameter>
<ac:rich-text-body>
<p>
<br/>
</p>
</ac:rich-text-body>
</ac:structured-macro>

Alex

Matthew Johnson
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
March 17, 2022

Hi Alex,

 

Thanks, that clarified things for me - I've got it working! Also, the video was helpful to pull it all together.

 

Matt

0 votes
Fabian Lim
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
March 14, 2022

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events