SharePoint Designer workflow strips server name from url
I have created a workflow on the announcements list to send the details in a table. However, if the body of the announcement contains a URL this is displayed in the workflow email as a relative path minus the server name.The body of the announcement is displayed in the WF email via a lookup [%announcements:body%].Interestingly, if I create an alert on the announcement list for the same item, the link sent from the standard alert email works fine.This is driving me to distraction - along with the fact that the url that is put in the announcement body using the hyperlink button is the only way of embedding URLs as if you cut and paste them the spaces are misinterpreted for %20 etc .I would like to understand what thought process to place around the whole area of how URLs are interpreted by sharepoint and the browser - but that may be too much for this post.
October 2nd, 2009 10:43pm

SPContext.Current.Web.Url returns the server URL and then item.Url returns the rest of it. It was a bit strange at first but I think this has its uses. As for the spaces in the URL, I tend to try to not create URLs with spaces While the name itself might be "My Document Library" I have the link set to (site)/docs/ Sharepoint is pretty inconsistent sometimes with the correct displaying on URLs with spaces. Hope this helps.Kevin
Free Windows Admin Tool Kit Click here and download it now
October 2nd, 2009 10:53pm

Thanks for your reply,I forgot to mention that this WF was created with SharePoint Designer.I dont have access to create workflows with VS2008.I need a method that I can use with SPD. RegardsDerek
October 2nd, 2009 11:46pm

If you're using SPD, use the "Encoded Absolute URL" field to get the full URLKevin
Free Windows Admin Tool Kit Click here and download it now
October 2nd, 2009 11:55pm

That will give me just the URL of the list item.My problem is that if someone creates an annnouncement post using the rich text editor, when they embed a URL in the body of the announcement this is what is getting stripped when I send the body via a WF email. The email looks up the body via the "add lookup" button on the WF email editor. For instance the url http://www.joebloggs.com/sites/00345/default.aspx posted in the body of the announcement would appear as the full url in the text but the source would show "<a href="/sites/00345/default.aspx" > ie lost the server name / domain name in the process.The same body of the announcement sent from the alert event on the list would shown the same body information but the link would be correct. Must be something that SPD is doing - I thought it might be the workflow email editor that might be causing it.
October 3rd, 2009 12:06am

Here is a solution that has worked for me... Similar to hardcoding the server name and then appending with the Server relative URL, you just take it one step further and type the whole path to the list or library and then just add the Current Item Name to the end of the URL. Your HTML will look something like: http://server name/site name/Shared Documents/[%Shared Documents:Name%] Hope that helps. Jen Dodd
Free Windows Admin Tool Kit Click here and download it now
July 2nd, 2010 8:17pm

See the RRFreeman SharePoint Architect blog for a manual workaround: http://rrfreeman.blogspot.com/2010/12/emailed-relative-html-rich-text-column.htmlRobertRFreeman
December 28th, 2010 8:58pm

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics