within a repeating section I have a field titled evidence which is a yes or no choice. I am trying to come up with a solution where if there is 5 rows in a repeating section and 2 of those rows have the evidence field set to yes then the minimum attachments should be 2.
I assume I might need to use JavaScript.
Hi!
By merging together cool answer from Marian Hatala: attachments custom validation, together with OOB Nintex features, you can achieve it that way:
function GetNumberOfAttachments(attCtrlClassName){
return NWF.FormFiller.Attachments.GetAttachedFilesCount(NWF.FormFiller.Functions.GetFillerDivObjectForControl(NWF$("#"+NWF$("." + attCtrlClassName + " .nf-attachmentsRow")[0].id)).data('controlid'))
}
GetNumberOfAttachments("AttachedEvidences") != sum(EvidenceNeeded)
WhereRegards,
Tomasz
Tomasz Poszytek, got any solution for responsive forms?
Nope, I don't. I suggest you to play around with rules. Maybe it would work if you use expressions to count rows and attachments, then to compare both outcomes. But I don't know if that is feasible.
Best regards,
Tomasz Poszytek
e-mail: tomasz@poszytek.eu
tel: +48 603 993 372
www/ blog: https://poszytek.eu
twitter: @TomaszPoszytek
I am curious about whether this solution still works? Both myself and colleague have spent ages trying to get this to work in O365 Classic forms with no success. Following these steps exactly I always get a value of zero returned regardless of how many attachments there are. I need to get this value on the form prior to the first save to properly validate a Save as Draft vs Submit button. I.e. the user should be able to save the form as draft with no attachment but at least one attachment is required to submit.
Elias Hantzis has my solution worked for you? If so, please mark my answer as correct. Thanks!
Regards, Tomasz
Hi Tomasz,
I haven’t had time to implement this solution. My apologies.
Regards,
Elias Hantzis
ICT Administrator
Country Regional Network
Level 1, 20 Smith St, Parramatta NSW 2150
P. 02 9685 5102 | M. 0429 316 344
E. elias.hantzis@jhg.com.au<mailto:elias.hantzis@jhg.com.au> | W. www.jhrcrn.com.au<https://urldefense.proofpoint.com/v2/url?u=http-3A__www.jhrcrn.com.au_&d=DwMFAg&c=lf6PGhmJKTmtyLqIXF-b3g&r=oi-x6Eop3DYWSyK3Jf-DWEBgAuveIetvY3OetEzQWds&m=iulocyipyzo_ZFuzm6Y5X2-1n4dMex3ucEShrZ0eegg&s=OL14ujiwqUNA-ejEfAZjSMPA_PuC5pH8g1eI_daROL4&e=>
No problem. Find your time and post a feedback
The described solution was tested by me and was working fine.
Regards,
Tomasz
Hi Tomasz Poszytek,
I tried your solution on the responsive form and it's not working. It seems there is no validation at all in this control (even with simple validation rule).
Did you find other solution to this issue?
Regards,
Shiri
Hi,
that solution was indeed for Standard forms, not RWD. If there are no rules to count number of attachments in RWD forms, then there is no way to achieve it. If you need such functionality maybe consider switching back to Standard form?
Regards,
Tomasz