• No results found

A workflow triggers that generates a hyperlink (See the route) in the list item in a column called Map.

N/A
N/A
Protected

Academic year: 2021

Share "A workflow triggers that generates a hyperlink (See the route) in the list item in a column called Map."

Copied!
7
0
0

Loading.... (view fulltext now)

Full text

(1)

1

Using a Workflow String to Dynamically Generate a Map with Driving Instructions

One of SharePoint Designer workflows actions is the ability to create a string that contains information that is

dynamically derived from multiple data sources. This use case demonstrates how to create a string of values in an API format that can invoke an external application. In this use case an organization may have many locations and you want to provide a form that will generate driving instructions from any arbitrary location to any of the organization’s

locations. In this simple application a user opens a form (in this case a list form) and selects the locations from a drop-down menu. They enter their address in a text field and their zip code in another field and then Save as shown below.

A workflow triggers that generates a hyperlink (See the route) in the list item in a column called Map.

Clicking on the hyperlink launches Bing maps and automatically generates the driving instructions using the respective starting and ending addresses entered in the list form.

(2)

2

Step one in creating this application is to create a custom list with the required fields as shown below.

Define Office Locations as a Choice column and add several addresses as choices. Do not use commas in the addresses as this will generate a misformed string that will fail to work.

Now we will create the workflow. This workflow will work identically when created as SharePoint 2013 or 2010

workflow, on either platform. It is always a best practice to create a reusable workflow and then associate the workflow to a list later. As I was lazy (and this workflow is so easy to create) I created it from the list directly.

(3)

3

The first thing you will do in the workflow is add an Action, Extract Substring from Index of String, that is found in the Utility Actions section of the Actions drop-down selection list as shown in the screen capture below.

In SharePoint Designer 2007 this was the Build Dynamic String action. In SharePoint 2010 and 2013 it has been renamed Extract Substring from Index of String.

This action will display in the workflow as follows:

Click on “string” and the action will display the option to select the ellipses button or formula button as shown below.

Select the ellipses button to open the String Builder dialogue box. In this box you will paste the following string. http://maps.live.com/default.aspx?v=2&rtp=adr.[Office Locations]~adr.[Your Address]%2c[Zip Code], See the route

This string contains the parameters (starting location address, starting location zip code and ending location) in the format that can be passed to the Bing Live Maps API that will generate a directions map. The complete API instructions for creating these strings and the various settings for doing so can be found at

http://blogs.bing.com/maps/2008/04/10/live-search-maps-api/

After you paste this string into the String Builder you must substitute the actual values entered into the list for Office Locations, Your Address and Zip code. The proxies in the string for these values [Office Locations],[Your Address],[Zip Code] are just placeholders for the actual string insertions. This is accomplished by placing your cursor into the position where each of these placeholders are and click on the Add or Change Lookup button.

(4)

4

This will then display the Lookup for String dialogue screen where you will select the respective Field from source columns from the Current Item Data source, which is the List you created that this workflow is triggered from.

Substitute all three lookup selections for the placeholders and make sure there is only one left and right bracket [] left. The completed string will look exactly as shown below.

The next thing to do is create a Local Variable named URL as shown below. This Variable will contain the completed string with the actual values entered into the list.

(5)

5 VERY IMPORTANT INFORMATION:

In a SharePoint Designer 2013 workflow you must set the string “starting at” position to be “0” as shown below.

In a SharePoint Designer 2010 workflow, created either in SharePoint Designer 2010 or SharePoint Designer 2013, you must set the string “starting at” position to be “1” as shown below.

If you do not set this starting position correctly the string generated will be missing information from the beginning of the string.

Set the Output of the string to Variable:URL. This will write the generated string to the URL variable. You can also add d a Log to History list action and substitute Variable:URL for “this message” to see that the string has been generated correctly.

Finally add a Set Field in Current Item action and select the column Map to be the target field and then click the formula button. Select Workflow Variables and Parameters as the Data source and Variable:URL as the Field from source; As a String.

(6)

6

For the Transition to stage (if you created this as a SharePoint 2013 workflow) select the transition action End of Workflow. Your completed workflow will look as follows.

From the workflow settings page select Start workflow automatically when an item is created and Start workflow automatically when an item is changed as shown below.

(7)

7

Note that after the third parameter, Zip Code in the string generated there is a comma (,) followed by the text “See this route”. Any text after this comma will be the hyperlink label for the entire string and will be displayed in the Map column as shown below. You can substitute any text that you wish to display.

References

Related documents

When a compatible medication is added to the Glucose Intravenous Infusion, the solution must be administered immediately.. Those additives known to be incompatible should not

CSE: PHGI OTCQB: PHGRF Third Party Partnerships Primary Care Medical Clinics Pharmacies 10 revenue MODEL Onsite Medicine Juno EMR ClinicAid - medical billing MyHealthAccess -

© 2013 – 2014 CommonWell Health Alliance Inc. All rights reserved.  

Recent work suggests that learning-related emotions (LREs) play a crucial role in performance especially in the first year of university, a period of transition for

You will then specialise by choosing two elective / specialisation modules in areas such as International Corporate Finance, Risk Management and Ethics, and Advanced Inter-

To further confirm the common impairments in facial expression recognition in schizophrenia across French and Japanese cultures, the simple-simple main effect of diagnostic group in

Directional control valves are classified as follows according to the number of ports: ■ 2/2-way valve ■ 3/2-way valve ■ 4/2-way valve ■ 5/2-way valve ■ 4/3-way valve.. The

For us, a bio-inspired machine is a machine which takes probability distribution in inputs, computes with an arithmetic dedicated to the probabilistic model, transmits information