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

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.

Donwload Hub site pdf

Download SharePoint Online Tutorial PDF FREE!

Get update on Webinars, video tutorials, training courses etc.

>