Conditional Validation of Repeating Section Control

  • 7 January 2020
  • 1 reply
  • 9 views

  1. I have a form, with a repeating section shown below. The form will be sent to Approver 1 if any of the Markets is Argentina, Chile or Peru, and Approver 2 if any of the Markets is Colombia or Mexico.
  2. I want to validate e.g the Units Available control(s) in the Argentina, Chile and/ or Peru repeating sections when the form is with Approver 1, and likewise for Units Available control(s) in Colombia or Mexico repeating sections for Approver 2.
  3. In turn, I do not want validation on Units Available control(s) in Columbia or Mexico repeating sections when the form is with Approver 1, and vice versa. 
  4. I have put a Calculated Field in the repeating section with the formula: currentRowNumber(UnitsAvailable)-1 (this value is shown as 0, above "GVS" in the screengrab)
  5. The formula I have used for the Units Available validation (where Current Position == 2 for Approver 1, and MarketLATAM is the name of the Market control) is: isNullOrEmpty(UnitsAvailable[calcRow])&&(MarketLATAM[calcRow]=="Argentina"||MarketLATAM[calcRow]=="Chile"||MarketLATAM[calcRow]=="Peru")&&Current Position==2)
  6. My thought is that this should result in e.g. for the first repeating section:  isNullOrEmpty(UnitsAvailable[0])&&(MarketLATAM[0]=="Argentina"||MarketLATAM[0]=="Chile"||MarketLATAM[0]=="Peru")&&Current Position==2), or, if the Units Available control for repeating section 0 is empty and the market for repeating section 0 is Argentina, Chile or Peru and the current position is 2 then validate.
  7. However, this formula doesn't work, either using the calcRow value in #5 above, or just using "0" in #6 above - where am I going wrong?

6075iCE5FD94CBA7A42AE.png 

 


1 reply

Badge +17

Any chance you could export your form for me to take a look at. Might be something simple but your definition is slightly hard to follow.

Reply