Subsequent question response options based on initial question response

250
2
Jump to solution
08-24-2023 08:27 AM
JayHodny
Occasional Contributor III

Hello.  I am developing a refuse cart distribution application using Connect.  Office admin employees will be entering refuse cart transactions via 123 and Experience Builder, while the field employees will be using Field Maps smart forms to track the distribution, serial numbers, etc. of the carts.  On the customer side, we have two cart size options available, Small and Large.  Internally, we have two Small cart sizes (35 and 45 gallon) and one Large cart size (95 gallon).  While the 35 gallon inventory will be phased out over time, we have to continue to provide this option.  When a customer requests a Small cart, office staff selects Small in the Survey form.  From there, the field staff needs the option to select either size in the Field Maps smart form, so the initial Survey response (Small) needs to expose those two choices (35 and 45).  I believe I can add more fields and set this up using relevancy in the XLSForm.  Instead, I have been trying to find a more elegant approach (avoid adding questions/fields) by using various calculations (e.g., if) in the XLSForm.  Thus, is there a way to calculate a response (or use other XLSForm options) to expose two choices (35, 45) following the initial selection of Small.  My lack of experience is hindering my success.  If this is possible, I would to extend the idea so that when Large is selected initially, the only option exposed/defaulted to is 95.  Any input would be appreciated.  Many thanks in advance, Jay

0 Kudos
1 Solution

Accepted Solutions
Jim-Moore
Esri Regular Contributor

Hi Jay

Please see the attached example. Would this approach help?

This XLSForm uses an if() statement in a separate cart_capacity question to record the capacity (gallons) based on the user's selections. The select_one questions are set up so the user only needs to specify a capacity when the cart size is Small.

if(${cart_size} = 'large', 95, ${capacity_small})

Optionally:

  • You could apply the hidden appearance to the cart_capacity question so users don't see it in the form.
  • You could specify null in the bind::esri:fieldType column for the capacity_small question if you don't want to create a field for this question in the feature layer.

Best, Jim

View solution in original post

0 Kudos
2 Replies
Jim-Moore
Esri Regular Contributor

Hi Jay

Please see the attached example. Would this approach help?

This XLSForm uses an if() statement in a separate cart_capacity question to record the capacity (gallons) based on the user's selections. The select_one questions are set up so the user only needs to specify a capacity when the cart size is Small.

if(${cart_size} = 'large', 95, ${capacity_small})

Optionally:

  • You could apply the hidden appearance to the cart_capacity question so users don't see it in the form.
  • You could specify null in the bind::esri:fieldType column for the capacity_small question if you don't want to create a field for this question in the feature layer.

Best, Jim

0 Kudos
JayHodny
Occasional Contributor III

Hi Jim,

Let me try this. I was trying something similar, but it was not working.  Many thanks.

Jay

0 Kudos