cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Two Attachment Controls on form, one is conditional

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!!

Labels: (1)
0 Kudos
Reply
5 Replies
Automation Master
Automation Master

Re: Two Attachment Controls on form, one is conditional

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"?>

<FormVariables>

    <Attachments1 type="System.String">ie_mem.jpg;ie_mem_1.jpg;ie_mem_2.jpg</Attachments1>

    <Attachments2 type="System.String">vst_meno.pdf;vst_meno_1.pdf;vst_meno_2.pdf</Attachments2>

    <Attachments3 type="System.String">blue_question_mark.png;blue_question_mark_1.png;blue_question_mark_2.png</Attachments3>

</FormVariables>

Reply
Not applicable

Re: Two Attachment Controls on form, one is conditional

So, what I would do is create a variable for each and use the one I need to be the proof attachment in the Run If action?

0 Kudos
Reply
Automation Master
Automation Master

Re: Two Attachment Controls on form, one is conditional

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

Reply
Highlighted
Not applicable

Re: Two Attachment Controls on form, one is conditional

A little bit, but thank you!

0 Kudos
Reply
Automation Master
Automation Master

Re: Two Attachment Controls on form, one is conditional

just dive into it.

once you have some specific problems, continue the thread and somebody will definitely help you.

Reply