Haaron Gonzalez Rotating Header Image

SharePoint Designer

How to copy the body of your email action in Workflow Designer using SharePoint Designer

This is for my friends and customers that still support SharePoint 2010 workflows and solutions using SharePoint Designer 2010. Have you been in the situation to re-create a SharePoint Designer 2010 workflow and notice that you cannot copy or paste the body of your Email actions forcing you to re-create your action from scratch? What a hassle.

Well, today I found a way that copy the content of your action attributes and with that simplify a little bit the experience of recreating Workflow Designer actions.

Step 1: Locate the Send Email action in your workflow and open the Properties window

SPD1

Step 2: Select the content of the Body attribute in the property window, right click and copy

SPD2

Step 3: in your new Send Email action open the Properties window

SPD3

Step 4: Click the “…” button

SPD4

Step 5: Paste the content of your clipboard

SPD5

Step 6: Click OK and just re-assign you lookup properties

SPD6

How to create hyperlink that open InfoPath client software a.k.a InfoPath Filler

Today was my second on site visit of the year and during my visit I was requested to fix one of the most frequent issues you will find when building workflow based solutions using SharePoint Designer and InfoPath client forms.

So an email activity in the Workflow Designer has a Hyperlink that it supposed to load a InfoPath form instance when the user clicks, in this scenario, the InfoPath solution runs in InfoPath Form Filler so when the users clicks the hyperlink it should load InfoPath Filler client application.

Turns out that using Encoded Absolute URL field that has the actual URL address of the form instance inside of the <a href=””> tag is not enough and will cause user to open Internet Explorer and try to load the form with InfoPath Form Services but because the form was designed to run in InfoPath Filler an exception will happen and users will be NOT so happy.

The solution is pretty simple; we just need to change the URL we will use to invoke InfoPath Filler to load inside of the anchor tag. Also I recommend using the Hyperlink button available in the email body of the message.

Hyperlink control in Send Email

 

The URL should have the following Workflow and Current Item variables:

  • %Workflow Context:Current Site URL% will get the URL of the current site where the workflow is running
  • /layouts/FormServer.aspx is a system web page that is used by InfoPath Form Services to render the form in the browser
  • XmlLocation is a query string variable that will tell to FormServer.aspx where the form data is located and it will use to load the form in the browser. We use the Workflow variable % Workflow Context:Current Item URL% to get the XML file
  • ClientInstalled = true is another QueryString variable that will thell the FormServer.aspx page that the form should be loaded in the client software, in this case our beloved InfoPath Form Filler
  • Source query string variable is used by the FormServer.aspx page to redirect the browser to the URL we want to load when we close the form, this work on InfoPath Form Services, nothing to do to InfoPath Filler
  • DefaultOpen is another query string variable that tells formserver.aspx how to load the form

Here you can see official information about the InfoPath parameters

So the definition of the hyperlink data is:

 

String concatenation to generate URL

The result will be something like this:

http://intranet.mycompany.com/sites/IT/finance/_layouts/FormServer.aspx?XmlLocation=http://intranet.mycompany.com/sites/IT/finance/IT Project/ITP20151030200643.xml&ClientInstalled=true&Source=http://intranet.mycompany.com/sites/IT/finance&DefaultOpen=0

So remember, red text is going to be generated by SharePoint Designer Workflow Variables, Bold text is going to be hard coded in the concatenating string.

Good luck!