I have a file attachment control, in a repeating section so that there can be more than one, that need to be saved to a SharePoint list. I have it set up so that when an end user attaches a file with an invalid character in the file name, they will receive a message letting them know they have to rename the file before they can attach it and then the rule removes the file from the attachment field (leaving it blank). I can get this to work great on the first file attachment, but if there are multiple attachments, the rule doesn't work on anything after the first attachment.
Here's how I did it: I set a rule on the file attachment control that when it changes, to set the qRules Command field to: concat("GetAttachmentAttribute /xpath=/my:myFields/ my:attachmentsSection/my:group19/my:Attachments/my:attachment [", count(preceding-sibling::Attachments/attachment) + 1, "] /attr=Name") then I set the Name field to result. As mentioned, it works perfectly on the first file attached, but when I try it on the 2nd file attached, the error in the Qrules error field reads "Failed to select the attachment node.".
Any ideas?