I have an InfoPath form that has 4 File Attachment controls on it that are all optional. The workflow needs to attach these files to the notification email when asking for approval.
I can successfully attach all 4 files to a Flexi Task action without any issue as long as there are 4 files attached. If I configure the Flexi task and add all 4 file URLS in the attachments section I will get a (Error).txt file (see below) that is attached for any URL that is blank.
My workflow is extracting the Infopath File attachments to a Library and storing the URLs in Variables (File1, File2, File3, File4) so I can tell which/how many files I have by which variables have values (not blank), but I have not been able to find a way to add these files to the flexi task dynamically. I tried to build a string variable but did not know if they needed to be delimited or each entry on a new line. Has anyone had any success in doing this or know what I need to do to add an attachment to an email (flexi task notification) in the workflow?
(Error).txt
Error attaching file from .
System.UriFormatException: Invalid URI: The URI is empty.
at System.Uri.CreateThis(String uri, Boolean dontEscape, UriKind uriKind)
at Microsoft.SharePoint.SPSite..ctor(String requestUrl, SPUserToken userToken)
at Nintex.Workflow.HumanApproval.MessageAttachment.GetAsMailAttachment(INWWorkflowContext context)