Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

Is the File/Attachment field "immune" to rules?

Jane Smith March 14, 2025

Is it possible to create a rule for:

1) Hide and Show the "File/Attachment" based on conditions? I followed this guide for another field and it worked, but doesn't seem to work for hiding the "Choose Files" buttons.

2) Similarly, I followed another guide to make the field required when it shows, but when I upload the attachment, I continue to get the error despite the condition being fulfilled.

How should I approach this?

 

1 answer

Suggest an answer

Log in or Sign up to answer
0 votes
Alex Medved _ConfiForms_
Community Champion
March 17, 2025

Hi @Jane Smith 

Hide/Show rules work for File/Attachment field absolutely the same way as with other field types

Same with the conditionally applied validations

Video

Configfuration

<ac:structured-macro ac:name="confiform" ac:schema-version="1" ac:macro-id="4b3df216-3256-47ba-a0ee-4477959aebe1"><ac:parameter ac:name="formName">form</ac:parameter><ac:rich-text-body><ac:structured-macro ac:name="confiform-entry-register" ac:schema-version="1" ac:macro-id="c58a95b4-e8cb-42e0-8c36-e3c576561d49"><ac:rich-text-body><p><br /></p></ac:rich-text-body></ac:structured-macro><p><ac:structured-macro ac:name="confiform-field-definition" ac:schema-version="1" ac:macro-id="eb9297bc-9fc6-4fb2-8401-a984e33dc3e1"><ac:parameter ac:name="fieldName">showhide</ac:parameter><ac:parameter ac:name="fieldLabel">Show/Hide file/attachment</ac:parameter><ac:parameter ac:name="type">checkbox</ac:parameter></ac:structured-macro> <ac:structured-macro ac:name="confiform-field-definition-rules" ac:schema-version="1" ac:macro-id="e764cf99-3970-40db-975a-c9e914d9f998"><ac:parameter ac:name="condition">showhide:true</ac:parameter><ac:parameter ac:name="fieldName">fileattachment</ac:parameter><ac:parameter ac:name="action">Show field</ac:parameter><ac:parameter ac:name="actionFieldName">showhide</ac:parameter><ac:parameter ac:name="withReverseRule">true</ac:parameter></ac:structured-macro> <ac:structured-macro ac:name="confiform-field-definition-rules" ac:schema-version="1" ac:macro-id="1d5edd6f-f5cb-4613-b24f-266dcd9d7095"><ac:parameter ac:name="condition">showhide:true AND fileattachment:[empty]</ac:parameter><ac:parameter ac:name="fieldName">You need to upload a file</ac:parameter><ac:parameter ac:name="action">Validation rule</ac:parameter></ac:structured-macro></p><p><ac:structured-macro ac:name="confiform-field-definition" ac:schema-version="1" ac:macro-id="2bd027a6-a7c3-45a3-a2c3-cf3bffa52cf7"><ac:parameter ac:name="fieldName">fileattachment</ac:parameter><ac:parameter ac:name="fieldLabel">fileattachment</ac:parameter><ac:parameter ac:name="type">file</ac:parameter></ac:structured-macro></p></ac:rich-text-body></ac:structured-macro><p><br /></p>

Alex

Jane Smith March 17, 2025

Thanks @Alex Medved _ConfiForms_ - I found the issue on my end... I had the incorrect field name. The name was "emailAttachment" but I had "attachmentEmail". SMH. Watching your video helped me to double check since I was following those steps. Thanks again!

TAGS
AUG Leaders

Atlassian Community Events