10

I see option to use lwc as global action but there no information about how to configure xml to be able use component. setup

4
  • I could only get an Aura component to show up in that UI and perhaps. LWCs do now work for Object actions. (Sorry to waste your time with the answer I've now deleted.)
    – Keith C
    Aug 30, 2022 at 13:39
  • 3
    It seems this is part of Winter '23 Release. I could see the Component in the dropdown using 'lightning__GlobalAction' as target, but the Action is not visible in the Global Action menu even after adding in the Publisher Layout.
    – Saroj Bera
    Aug 30, 2022 at 14:33
  • 2
    @SarojBera, I would add your comment as the answer. Setting my component to API version 56 allowed it to be selected here.
    – nbrown
    Oct 27, 2022 at 14:32
  • @nbrown, please add.
    – Saroj Bera
    Oct 27, 2022 at 16:48

3 Answers 3

7

Add the target of lightning__GlobalAction

<?xml version="1.0" encoding="UTF-8" ?>
<LightningComponentBundle xmlns="http://soap.sforce.com/2006/04/metadata">
   <apiVersion>56.0</apiVersion>
   <isExposed>true</isExposed>
   <targets>
        <target>lightning__GlobalAction</target>
   </targets>
    <targetConfigs>
   <targetConfig targets="lightning__GlobalAction">
        <actionType>Action</actionType>
      </targetConfig>
 </targetConfigs>
</LightningComponentBundle>
3
  • Can you add documentation @viva-la-cubs Nov 15, 2022 at 16:14
  • 1
    this worked for getting my LWC to show up as an option when i create a new action. My LWC will not show up in the global header after adding to publisher layout, but that may be because the LWC launches a screen flow, which just came out in W23.
    – gorav
    Nov 16, 2022 at 23:17
  • This worked for me.
    – Keith C
    Mar 30, 2023 at 9:40
3

Even after setting target to 'lightning__GlobalAction' and actiontype to 'ScreenAction', the LWC is only available in the options of global action however it is not displayed in the global actions despite adding it in the publisher layout .

Solution : I created an Aura component for Quick actions, then I embedded the LWC in the Aura component I just created. Finally, I created a global action with the Aura component and added it to the publisher layout.

0

According to this document, a lightning web component can be added as a quick action on record pages only. LWC cannot be used as a global quick action. Aura is the only way around this.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .