I have 3 attachment controls with one set to default. They each have unique name and a CSS class "attCtrl."
I need to be able to verify that each has been uploaded, or not null. If one is null I need to know which one.
I thought I could use the name of the control to determine if it was "not empty," but I have not been able to do that.
Does anyone have any advice for this?
Solved! Go to Solution.
have a look on this my little function https://community.nintex.com/message/42747?commentID=42747#comment-42747
They each have unique name and a CSS class "attCtrl."
have you configured just the same class name for each of 3 controls?
you will have to give them unique class names, that will as well help you to identify which one breaks the rule.
Thank you for your reply.
I have tried several different ways prior to creating this post, and have been unable to get your function to...well... function
Could you provide a more detailed example? ie. where to put your function and how to call it?
thank you yes this does help! I was able to validate a with it.But shouldn't I be able use the number too?
So I used
on a attachment control. With no attachment it catches it and displays the error. With an attachement it lets the process finish. So I know it's working. But I am not able to display the number no matter how many attachments the number remains '0.'
I have added
to calculated values and form variables but cannot get the number to change.
I'm not sure I understand what are trying to do...
do you want to display current number of files uploaded to a given attachment control, and do you want it to dynamically change once you add or remove one?
if so, then the reason is that this formula doesn't anyhow depend on that specific attachment control, hence it need not to recalculate once attachment control changes.
I wonder whether you really need it, or whether it was meant just as a kind of proof check to see how does it evaluate.
the problem is that attachment control is not listed among named controls, so it can not be directly referenced in calculation formula.
if you really needed to see current number of attached files, it would require some further scripting.
I've never investigated that so I'm not sure how complex it might be.
thank you for your response.
Yes I guess I was trying to see how many were uploaded be for the form was submitted. But I also tried to save the number of attachments by linking it to a field and that did not work either.
I have 3 attachment controls. They are not visible until after the form has been submitted, and a user returns to the form to upload documents.
My end goal is to not validate the attachment control being empty until the user returns.....
Oh wait... so I can use another "yes/no" field to add to the validation, switch it on submit then validate once the user returns!
Does that make since? I guess I just needed to talk through it.
I think you do not need any further checkbox.
it looks like you want to apply validation only when user edits existing item, and not apply it when it creates new one.
if so the have a look on 'IsEditMode' common reference.
your formula then might look like
IsEditMode && GetNumberOfAttachments('attCtrl')<1
Marian Hatala - Should I be able to use an If() statement in a calculated column to save a "No" or "Yes" based on this script? I'm trying to use this variable in a workflow.
in workflow you can use ItemProperty:Attachments reference to determine whether an item have any attachment. you do not need to save it on your own.
it evaluates to true/false.