function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
EranVEranV 

QuickActionAPI's getSelectedAction() doesn't return any value

Hi,

In a lightning controller, I'm trying to get which quick action on the page this component was fired from (trying to reuse the same component for multiple action buttons on the same object).

After a long research I came across the quickActionAPI and its getSelectedAction() method which appears to be exactly what I need.

component.find("quickActionAPI").getSelectedActions().then( function(result){
alert(result.actions[0].actionName);

} ).catch(function(e){
if(e.errors){ alert (e.errors);
}
});

However, whenever clicking the action button, I always get an error result of "There’s no action selected in the page. Select an action to continue.". 

Using other methods such as getAvailableActions does get the available actions on the page, so obviously the page context exists. What am I missing here?

Thank you!