I have a SharePoint add-in that create a "button" on the page ribbon. When the user clicks on the button, it makes a call to a provider hosted app that resides in Azure. The request goes through, but I need to know the URL of the page where the button was clicked. For example, the page where the icon is clicked is:
https://xxx.sharepoint.com/sites/TDC/en-us/SitePages/Test4.aspx
In my AppManifest.xml
, I have the following:
<StartPage>https://yyy.azurewebsites.net?{StandardTokens}&SPSource={Source}&SPItemURL={ItemUrl}</StartPage>
In my elements.xml
, I have the following:
<UrlAction Url="~remoteAppUrl/ContentExport.aspx?{StandardTokens}&SPSource={Source}&SPItemURL={ItemUrl}"></UrlAction>
<CommandUIHandler Command="Invoke_ContentExportAction3ButtonRequest"
CommandAction="~remoteAppUrl/ContentExport.aspx?{StandardTokens}&SPSource={Source}&SPItemURL={ItemUrl}"/>
The ItemUrl
does not get resolved, which I believe makes sense for a StartPage
. The source gives me the following:
SPSource='https://tdctranslations.sharepoint.com/sites/TDC/en-us/_layouts/15/commandui.ashx'
Is it possible to get the URL of Test4.aspx
?