I am having a problem with assigning an attachment name in my send with document process.
I can successfully send the email with the document but it doesn't have a filename. I have the xml data in an xml type variable and have verified that it is there using variable logger.
My problem is that I can't get the data out of of the xml variable to assign the name of the form being emailed. I need to use three different nodes for the file name. I have tried xpath and template but have had no luck.
The Attachment field is expecting a document variable and not XML. To get the XML into a document variable you will have to create a new variable of type document, then using a setValue service you can equate the XML variable (the right side of the equation) to the document variable (the left side of the equation).
The attachment filename can be an XPath expression where you build the name from the three values you want in the XML variable. In the Attachment name field (by default it is a literal value - change this to an XPath expression). The input box will change and a button with three dots will appear. Click the button and the XPath editor will appear. Now you can build an XPath expression to represent your file name. In the center of the XPath Builder is a dropdown that has different categories of XPath expressions. Choose the string category, the box below it will show all of the XPath string functions that are available. Choose the concat function, and replace the strings with what you want.
To get a value out of your XML var you can place your cursor where you want the expression to appear in the statement then choose your var from the list of variables at the top of the builder (double click it). The expression /process_data/xmlVarName will appear. You can add a //nodename to have XPath search through your XML and get the value back. This will be placed in your concat expression. So if we were lookinng for a node called file_name and file_extension (in the same XML file) your expression would look like this: