Hello everyone…since I am so new to the workflow world I am running into little problems here and there with my workflows, and I am so grateful for the help I have been receiving and for any help on this.
I have two attachment controls on one form. The workflow is for a Training Request. They have two options to choose from: Programs are workshops, seminars, and such, which the need to have an attachment option to add any information for the program inside the panel which is hidden, and the second option is College/School, which is in its own hidden panel. Programs need an attachment option, College/School does not, but they both need an attachment option after they complete the program, college/school.
The second attachment is at the bottom of the form and is visible in Edit View. This attachment control is for when they complete the Program (attach proof they were there) and for College/School courses they attended and need to attach the bursar bill with grades.
After they attach their "proof" attachments, the workflow goes to the Calculated Date “Use date when action is executed…” and the Run If action runs and an email notification lets them know that their attachment is received. HR, and their manager receives the same notification. How do I make the Run If to only apply to the second attachment or is there another way of doing this? Any help on this right away would be appreciated!!
if it's enough for you to know attached file names, then you can examine (hidden) FormData column. it should hold all the data that are not saved to list columns, and it looks it as well keeps track of names of attaches files.
I have created simple form with 3 attachment controls (Attachments1-3) and uploaded 3 files to each.
this is what I could see in FormData column
<?xml version="1.0" encoding="utf-8"?>
as you can see FormData column content is a XML structure, so you will need to use Query XML action to read respective attachment variable(s) out of that.
depends on how many outputs will xpath query with query XML action return you either will need to store results into single string variable (one single output) or collection variable (multiple outputs).
then in case of collection variable you will need to loop the collection and parse every single collection element for attachment file names.
in case you got returned simple string you can parse it directly.
to parse file names the best will be to use regular expression action and it's split operation. it will place single file names to another collection.
then finally, again depends on your requirements, you might just need to check number of elements within the collection (just to check how many files were attached) or you might need to loop through the collection the get/check every single file name.
hope, it doesn't sound too complicated