I have a provider hosted add-in running on a SharePoint Online development site that has several lists as part of the solution. My goal is on when somebody clicks a Ribbon CustomAction associated with an app list, that it goes to a Controller Action in my provider app and that View is returned.

I have seen my examples which use {StandardTokens} in the CommandAction url such as this example.. However when I click the command action the Url does not replace {StandardTokens}, that is the text "{StandardTokens}" appears in my querystring.

My CommandUIHandler Element:

<CommandUIHandler Command="Invoke_BonusApproveRibbonActionButtonRequest"

An example output Url:


In attempting to solve this problem I went as far as to put all of the tokens in the querystring when visiting the lists that were part of my add-in. My thinking was that the elements in StandardTokens needed to be present in the page when clicking the action. This did not work. Nor did listing the elements that make up StandardTokens individually in the CommandAction attribute.


<Elements xmlns="http://schemas.microsoft.com/sharepoint/">
  <CustomAction Id="c940f2b7-0bfa-404c-9920-6920af78ca89.BonusApproveRibbonAction"
                RegistrationType="List" RegistrationId="100" Location="CommandUI.Ribbon"
                Sequence="10001" Title="Invoke Approve Bonus Ribbon Action">
        <CommandUIDefinition Location="Ribbon.ListItem.Actions.Controls._children">
          <Button Id="Ribbon.ListItem.Actions.BonusApproveRibbonActionButton"
                  Alt="Approve Bonus" Sequence="100"
                  LabelText="Approve Bonus" TemplateAlias="o1"
                  Image32by32="images/check-32.png" Image16by16="images/check-16.png" />
        <CommandUIHandler Command="Invoke_BonusApproveRibbonActionButtonRequest"
  • Please share the entire element.xml file. – SlackerAmit Feb 22 '16 at 21:29
  • aren't you missing the fileextension ".aspx" in the CommandAction? – ReTech Feb 23 '16 at 17:19
  • No this is a Mvc Route. The page loads correctly. – Daniel Gimenez Feb 23 '16 at 17:56
  • what value do you expect standardtokens to be replaced with? – Gwny Feb 24 '16 at 7:47
  • SPHostUrl=...&SPLanguage..&SPClientTag=0&SPProductNumber=....&SPAppWebUrl=... trying to use the individual tokens doesn't work either. {SPHostUrl} etc... >> also StandardTokens does work when I start my remote app. – Daniel Gimenez Feb 24 '16 at 15:16

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.