cancel
Showing results for 
Search instead for 
Did you mean: 
Workflow Hero

Get Site GUID

Is it possible to use a Call Web Service to get the GUID of a site? My research indicates that this is only possible via PowerShell. If it's possible for the workflow to get a list GUID, is it possible to also get a site GUID?

0 Kudos
Reply
3 Replies
Workflow Hero

Re: Get Site GUID

Hi,

You can use REST API call with Web Request action on on-premise workflows as shown below.

1. Web Request action, store output into a multiline text variable

2. Query XML action - store ID to a single line text variable, xpath query should be, "/defaultNS:feed/defaultNS:id as shown below.

3. Log in history txtWebID variable.

To check if you get correct ID, type in this url in browser - http://<<your weburl>>/_api/web/webinfos

Thanks,

Krishna.

Accept as Solution Reply
Workflow Hero

Re: Get Site GUID

Hi, Krishna.

Thank you so much! In my workflow, I cannot use the common Web_URL. I'm working with an export list of all the sites in our farm. We found that the URLs do not make a good key because they can contain commas. So we want to get the site GUID instead. I have each site URL in a variable and I want to use that in my call in place of the Web_URL. It looks like the structure of the Web_URL and site URL in my variable are basically the same:

Web URL: http://collection.company.url/sites/workflow/site

Site URL: http://collection.company.url/other

Is there a reason why I can't use the Site URL in my data? Does it need to be formatted differently?

0 Kudos
Accept as Solution Reply
Workflow Hero

Re: Get Site GUID

Hi,

What issue you see if your are trying with  http://collection.company.url/other? Have you tried calling the REST api with  http://collection.company.url/other/_api/web/webinfos in the browser?

Thank you,

Krishna.

Accept as Solution Reply