I’m building out a little thing for the company’s recruiters for when we add a friend to the list. An email goes to the boss of all of the recruiters saying one dropped. I have a link to the resume and the item, but I also had all of the pertinent information in the email. So even though the boss would be able to click on the link, go to the list item and click on my custom button to assign a recruiter, I thought I could cut out a step. I just created a link to the workflow I use to assign the recruiter.
The URL for that looks like this:
https://xxxxxxxxxxxxxxx.sharepoint.com/wfsvc/6f981489c973485293741943682bda4a/WFInitForm.aspx?List={1519fb4a-ef7b-468f-ad4f-7b0b2fea8f6a}&ID=8&ItemGuid={83D33457-7C55-41F9-938D-69143006E3AC}&TemplateID={B7CB07B2-F62C-49D2-9848-11858888F65F}&WF4=1&Source=https%3A%2F%2Fxxxxxxxxxxxx%2Esharepoint%2Ecom%2FLists%2FReferAFriend%2FAllItems%2Easpx
I know that looks like a crazy URL to build, and it is.
First, you can strip off the source. That is so SharePoint knows were to drop you after you submit. It is coming from an email, so we only really need to build this:
https://xxxxxxxxxxxxxxx.sharepoint.com/wfsvc/6f981489c973485293741943682bda4a/WFInitForm.aspx?List={1519fb4a-ef7b-468f-ad4f-7b0b2fea8f6a}&ID=8&ItemGuid={83D33457-7C55-41F9-938D-69143006E3AC}&TemplateID={B7CB07B2-F62C-49D2-9848-11858888F65F}&WF4=1
It comes in a few parts. You know what list this is, so we have the front of the URL, the list GUID, the ID, the ItemGUID, and the template ID. Separating much of these are braces {} so that the URL is constructed correctly. I thought I could use this string:
Well, guess what. There is no way to add those braces to a string. Microsoft will send you back this error:
That is unless you put those into their own variables. So I made all of these variables for the GUID, ID, open bracket, and close bracket:
Then, I changed my string to this:
Now I am able to insert it into my email to the management.
The management doesn’t like going outside of Outlook for anything, so this is the best middle ground I could do until I build an Office Add-in. I might do that in three years.