An unhandled exception occurred during the execution of the workflow instance. The format of the URI could not be determined

The format of the URI could not be determined
SharePoint deveopment training course

Recently while working in a visual studio 2015 workflow for SharePoint online (Download PDF for FREE), I received the below error while running the workflow for a particular list item. The workflow went to a suspended mode and the error comes as:
An unhandled exception occurred during the execution of the workflow instance. Exception details: System.UriFormatException: Invalid URL: The format of the URI could not be determined. The error looks like below:

An unhandled exception occurred during the execution of the workflow instance
An unhandled exception occurred during the execution of the workflow instance

Solution:
In the workflow, we were using HttpSend workflow activity to retrieve the URL of the RootWeb. In HttpSend I was using a variable to return the value form CurrentWebUri value (which returns the site URL).

My HttpSend Uri value looks like below:
siteURL+”_api/Site/RootWeb”

The format of the URI could not be determined
The format of the URI could not be determined

The format of the URI could not be determined

Here the value which was coming in siteURL was like below:

https://onlysharepoint2013.sharepoint.com/sites/Bhawana (without “/” at the end)

So my HttpSend Uri was becoming like below:
https://onlysharepoint2013.sharepoint.com/sites/Bhawana_api/Site/RootWeb (missing “/” before _api)

So I changed my HttpSend Uri value to like below

siteURL+”/_api/Site/RootWeb”

Now it generates the URL correctly like below:

https://onlysharepoint2013.sharepoint.com/sites/Bhawana/_api/Site/RootWeb

Read some SharePoint online tutorials:

Hope this SharePoint tutorial helps to resolve the issue An unhandled exception occurred during the execution of the workflow instance. The format of the URI could not be determined.

Check out Best Alternative to InfoPath -> Try Now

free sharepoint training

SharePoint Online FREE Training

JOIN a FREE SharePoint Video Course (3 Part Video Series)

envelope
envelope

About Bhawana Rathore

Hello Everyone!! I am Bhawana a SharePoint MVP and having about 8+ years of SharePoint experience as well as in .Net technologies . I have worked in all the versions of SharePoint from wss to Office 365. I have good exposure in Customization and Migration using Nintex, Metalogix tools . Now exploring more in SharePoint 2016 :) Hope here I can contribute and share my knowledge to the fullest. As I believe "There is no wealth like knowledge, and no poverty like ignorance"

View all posts by Bhawana Rathore →