Select to view content in your preferred language

Field Maps, Minimum file count still required when media not relevant - workaround to required attachments?

371
11
Jump to solution
3 weeks ago
TL2
by
Frequent Contributor

I am trying to make an attachment required if a condition is met.  When I set a condition and a minimum file count it still requires the attachment even when the attachment item is hidden (condition not met).

Is there a way to require attachments based on a condition?

0 Kudos
1 Solution

Accepted Solutions
GarrettBellin
Esri Contributor

I just wanted to clarify the issue and resolution for everyone on this thread. The issue ultimately stems from a logic problem when building the form. When a user sets a required attachment question to be hidden (either manually or via an arcade script), then it becomes impossible to submit the form if the minimum file count is set to anything greater than 0. This issue stems from the following two sources.

  1. It isn't possible to set attachment questions to be optional. The only way to do this is to set the minimum file count to 0. So the question will be mandatory with a minimum file count of 1 or greater.
  2. Even when a question is hidden, the condition must be met if its not an optional question.

This presents a paradoxical situation where if an attachment question with a minimum file count of 1 or greater is hidden, a user can't submit their form. The following are potential resolutions:

  1. Keep attachment requirements at "0" if they will be hidden based on previous responses. This effectively makes the question optional.
  2. Two defects were logged on the Esri side. The first being a request to add the ability to make attachment questions optional via a check box. The second was a bug to make hidden questions optional when they are hidden since they create a situation where the user can't submit the form. 

View solution in original post

11 Replies
ToddW_stl
Esri Contributor

I'm not seeing this issue in ArcGIS Online (organizational account).  When I set my "attachment_required" question to "No", I am allowed to submit without an attachment.  When I select "Yes", my attachment question becomes visible, and required (min set to 1).  When I try to submit "Yes" without and attachment, i get an error (as expected).  My "Editable" and "Visible" Arcade expressions are the same for the attachment question.

ToddW_stl_0-1783387735610.png


20260707_012759346_iOS.png

ToddW_stl_1-1783387850256.png

 

 

0 Kudos
TL2
by
Frequent Contributor

I am not able to reproduce this.  Actually, when I try it will not work in the Map Viewer and in Field Maps I get an error - "The form contains unsupported data."

0 Kudos
ToddW_stl
Esri Contributor

are you attempting to edit a view?  have you tried with a new, simplified test version of the map and form, maybe just isolate the layer and add a form with the conditional question(s) and attachment question?

0 Kudos
TL2
by
Frequent Contributor

Yes , I created a new HFS with one field - required.  I placed the rule for Edit and Visible on both.  I set my domain values (yes,no).  I have the latest version of Field Maps.  I will open a ticket with ESRI.

ToddW_stl
Esri Contributor

please post a case/bug number and any other information you find out for others that may see similar issues!

0 Kudos
bbollin
Esri Contributor

@TL2 Can you send a screenshot of your form authoring settings? Do you have the media input set to Capture only? Also, if you are able to share the data with me/make it public please DM me and the team can investigate this further

0 Kudos
bbollin
Esri Contributor

Ok, thanks @TL2 for sending the repro data. From looking at the webmap you were using an editable expression on the attachment form element AND had a requirement of 1 attachment. To only enforce an attachment submission when a certain value is entered in a different field, you should use a visibility expression on the attachment element.

So the setup will be

  1. Attachment element requirement = 1
  2. Visibility expression on the attachment element to only show when Desired_Field = Desired_Answer

The requirement is only enforced when the element is visible. Hope this helps!

0 Kudos
DougMorgenthaler
Esri Regular Contributor

@TL2 for Field Maps specifically, can you confirm the version of Field Maps that was used?  If using a version prior to 26.2 that contains an attachment element, they will see this message.

0 Kudos
TL2
by
Frequent Contributor
  • BUG-000186472 Synopsis : Field Maps Designer allows users to have invisible, yet required attachment questions meaning that the form can't be submitted.
  • ENH-000186383 Synopsis : Add a choice to make an attachment question "optional" in Field Maps designer.
0 Kudos