Solved

Show/hide a control based on a field in a repeating section

  • 3 September 2019
  • 6 replies
  • 213 views

Badge +6

Hello, I'm building a responsive form for restricted site access.  The matrix of Area is kept in a custom list and accessed via look-up.

I have a look-up control for the Area with calculated fields to retrieve the competency and approver team for the selection.  This forms the row of a repeating section, so the users can add multiple areas. Usually the approver is a superintendent, but there are some areas with special access requirements.

I was hoping to have the special access person field appear in the approval section only when the user selects an area requiring special approval.

e.g. IT Approval.  The logic on the control - if all areas selected  in the repeating section do not contain "IT Approval" then hide the IT Approver field.

However, there isn't an Eval or Concat operator in Nintex.  Only numeric operators... e.g. Sum.

I thought I could place a number field in each row... If Approver = "IT Approver" then 1 else 0.  Then sum the total... If >0 then show field.  However, When I hid the numeric field, the calculation stopped working.  The number shouldn't be visible.

Wondering if anyone has a better idea!  Has to be a responsive form.

4231i280C5A64FED58D31.png

 

 

icon

Best answer by allan 25 September 2019, 16:48

View original

6 replies

Userlevel 3
Badge +9
The only way is to put the logic in the Workflow.
Use Query XML to extract the value of Approval Required in the repeating section into a collection variable. Then a For Each loop to walk through each instance of the Approval Required value. Then within a Run If block test the value and set a flag. After the loop, have another Run If block based on the flag to do the appropriate processing for the Special Approval case.
Badge +6
thank you
Userlevel 4
Badge +9

There's a better solution that you can use directly in your form.
Just use the "contains" function in your rule to hide your control. have a look at the screenshot.

Badge +6
Thank you so much! That is working a charm!
Badge +6
just in case anyone needs to know this, here is the formula I used - multiple repeating sections for various access areas:

!contains(NamedControl1,"Warehouse")&&!contains(NamedControl2,"Warehouse")&&!contains(NamedControl3,"Warehouse")

....then hide the Warehouse approver name field.

Thanks again Allan!
Userlevel 4
Badge +9

Glad to hear that ;)
I do not know if you can change the post marked as solution, but do not hesitate to try to ;)

Reply