{"id":139236,"date":"2018-08-17T14:13:59","date_gmt":"2018-08-17T14:13:59","guid":{"rendered":"https:\/\/webkul.com\/blog\/?p=139236"},"modified":"2024-02-28T10:21:50","modified_gmt":"2024-02-28T10:21:50","slug":"adding-custom-mass-action-in-admin-grid-in-magento-2","status":"publish","type":"post","link":"https:\/\/webkul.com\/blog\/adding-custom-mass-action-in-admin-grid-in-magento-2\/","title":{"rendered":"Adding Custom Mass Action In Admin Grid In Magento 2"},"content":{"rendered":"\n<p>In this post we will see how to add custom mass action in grid. Following this post we can add Mass Action to any grid.<\/p>\n\n\n\n<p>Customers Grid in Magento 2 is made by using ui_component. We will extend the customer&nbsp; ui_component file customer_listing.xml file in our module to add custom mass action.<\/p>\n\n\n\n<p>Create file customer_listing.xml in \/app\/code\/your_namespace\/your_moduleName\/view\/adminhtml\/ui_component\/<\/p>\n\n\n\n<p>In this file create mass action as below:<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\">&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;\n&lt;listing xmlns:xsi=&quot;http:\/\/www.w3.org\/2001\/XMLSchema-instance&quot; xsi:noNamespaceSchemaLocation=&quot;urn:magento:module:Magento_Ui:etc\/ui_configuration.xsd&quot;&gt;\n    &lt;listingToolbar name=&quot;listing_top&quot;&gt;\n        &lt;massaction name=&quot;listing_massaction&quot;&gt;\n            &lt;action name=&quot;sendconfirmation&quot;&gt;\n                &lt;settings&gt;\n                    &lt;confirm&gt;\n                        &lt;message translate=&quot;true&quot;&gt;Are you sure to send Confirmation Mail to selected customers?&lt;\/message&gt;\n                        &lt;title translate=&quot;true&quot;&gt;Send Mail&lt;\/title&gt;\n                    &lt;\/confirm&gt;\n                    &lt;url path=&quot;modulename\/index\/massSendConfirmation&quot;\/&gt; &lt;!-- your custom controller to handle request --&gt;\n                    &lt;type&gt;sendconfirmation&lt;\/type&gt;\n                    &lt;label translate=&quot;true&quot;&gt;Send Confirmation&lt;\/label&gt;\n                &lt;\/settings&gt;\n            &lt;\/action&gt;\n        &lt;\/massaction&gt;\n    &lt;\/listingToolbar&gt;\n&lt;\/listing&gt;<\/pre>\n\n\n\n<p>Now, when you will see the Customer Grid then you can find Custom Action has been added to drop down.<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" width=\"1198\" height=\"404\" src=\"https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2018\/08\/Screenshot_641.png\" alt=\"customer grid mass action image\" class=\"wp-image-139238\" srcset=\"https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2018\/08\/Screenshot_641.png 1198w, https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2018\/08\/Screenshot_641-250x84.png 250w, https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2018\/08\/Screenshot_641-300x101.png 300w, https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2018\/08\/Screenshot_641-768x259.png 768w\" sizes=\"(max-width: 1198px) 100vw, 1198px\" loading=\"lazy\" \/><\/figure>\n\n\n\n<p>That&#8217;s it for this post. Thanks \ud83d\ude42<\/p>\n","protected":false},"excerpt":{"rendered":"<p>In this post we will see how to add custom mass action in grid. Following this post we can add Mass Action to any grid. Customers Grid in Magento 2 is made by using ui_component. We will extend the customer&nbsp; ui_component file customer_listing.xml file in our module to add custom mass action. Create file customer_listing.xml <a href=\"https:\/\/webkul.com\/blog\/adding-custom-mass-action-in-admin-grid-in-magento-2\/\">[&#8230;]<\/a><\/p>\n","protected":false},"author":116,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[8,302],"tags":[],"class_list":["post-139236","post","type-post","status-publish","format-standard","hentry","category-magento","category-magento2"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v24.5 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Adding Custom Mass Action In Admin Grid In Magento 2 - Webkul Blog<\/title>\n<meta name=\"description\" content=\"How to add custom mass action in magento 2 grid?\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/webkul.com\/blog\/adding-custom-mass-action-in-admin-grid-in-magento-2\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Adding Custom Mass Action In Admin Grid In Magento 2 - Webkul Blog\" \/>\n<meta property=\"og:description\" content=\"How to add custom mass action in magento 2 grid?\" \/>\n<meta property=\"og:url\" content=\"https:\/\/webkul.com\/blog\/adding-custom-mass-action-in-admin-grid-in-magento-2\/\" \/>\n<meta property=\"og:site_name\" content=\"Webkul Blog\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/webkul\/\" \/>\n<meta property=\"article:published_time\" content=\"2018-08-17T14:13:59+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2024-02-28T10:21:50+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/webkul.com\/blog\/wp-content\/uploads\/2018\/08\/Screenshot_641.png\" \/>\n<meta name=\"author\" content=\"Ayaz Mittaqi\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@webkul\" \/>\n<meta name=\"twitter:site\" content=\"@webkul\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Ayaz Mittaqi\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"1 minute\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/webkul.com\/blog\/adding-custom-mass-action-in-admin-grid-in-magento-2\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/webkul.com\/blog\/adding-custom-mass-action-in-admin-grid-in-magento-2\/\"},\"author\":{\"name\":\"Ayaz Mittaqi\",\"@id\":\"https:\/\/webkul.com\/blog\/#\/schema\/person\/3a9d84d349b963ed99f7aead9372dd6d\"},\"headline\":\"Adding Custom Mass Action In Admin Grid In Magento 2\",\"datePublished\":\"2018-08-17T14:13:59+00:00\",\"dateModified\":\"2024-02-28T10:21:50+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/webkul.com\/blog\/adding-custom-mass-action-in-admin-grid-in-magento-2\/\"},\"wordCount\":115,\"commentCount\":2,\"publisher\":{\"@id\":\"https:\/\/webkul.com\/blog\/#organization\"},\"image\":{\"@id\":\"https:\/\/webkul.com\/blog\/adding-custom-mass-action-in-admin-grid-in-magento-2\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/webkul.com\/blog\/wp-content\/uploads\/2018\/08\/Screenshot_641.png\",\"articleSection\":[\"magento\",\"Magento2\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/webkul.com\/blog\/adding-custom-mass-action-in-admin-grid-in-magento-2\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/webkul.com\/blog\/adding-custom-mass-action-in-admin-grid-in-magento-2\/\",\"url\":\"https:\/\/webkul.com\/blog\/adding-custom-mass-action-in-admin-grid-in-magento-2\/\",\"name\":\"Adding Custom Mass Action In Admin Grid In Magento 2 - Webkul Blog\",\"isPartOf\":{\"@id\":\"https:\/\/webkul.com\/blog\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/webkul.com\/blog\/adding-custom-mass-action-in-admin-grid-in-magento-2\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/webkul.com\/blog\/adding-custom-mass-action-in-admin-grid-in-magento-2\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/webkul.com\/blog\/wp-content\/uploads\/2018\/08\/Screenshot_641.png\",\"datePublished\":\"2018-08-17T14:13:59+00:00\",\"dateModified\":\"2024-02-28T10:21:50+00:00\",\"description\":\"How to add custom mass action in magento 2 grid?\",\"breadcrumb\":{\"@id\":\"https:\/\/webkul.com\/blog\/adding-custom-mass-action-in-admin-grid-in-magento-2\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/webkul.com\/blog\/adding-custom-mass-action-in-admin-grid-in-magento-2\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/webkul.com\/blog\/adding-custom-mass-action-in-admin-grid-in-magento-2\/#primaryimage\",\"url\":\"https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2018\/08\/Screenshot_641.png\",\"contentUrl\":\"https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2018\/08\/Screenshot_641.png\",\"width\":\"1198\",\"height\":\"404\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/webkul.com\/blog\/adding-custom-mass-action-in-admin-grid-in-magento-2\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/webkul.com\/blog\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Adding Custom Mass Action In Admin Grid In Magento 2\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/webkul.com\/blog\/#website\",\"url\":\"https:\/\/webkul.com\/blog\/\",\"name\":\"Webkul Blog\",\"description\":\"\",\"publisher\":{\"@id\":\"https:\/\/webkul.com\/blog\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/webkul.com\/blog\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/webkul.com\/blog\/#organization\",\"name\":\"WebKul Software Private Limited\",\"url\":\"https:\/\/webkul.com\/blog\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/webkul.com\/blog\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2021\/08\/webkul-logo-accent-sq.png\",\"contentUrl\":\"https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2021\/08\/webkul-logo-accent-sq.png\",\"width\":380,\"height\":380,\"caption\":\"WebKul Software Private Limited\"},\"image\":{\"@id\":\"https:\/\/webkul.com\/blog\/#\/schema\/logo\/image\/\"},\"sameAs\":[\"https:\/\/www.facebook.com\/webkul\/\",\"https:\/\/x.com\/webkul\",\"https:\/\/www.instagram.com\/webkul\/\",\"https:\/\/www.linkedin.com\/company\/webkul\",\"https:\/\/www.youtube.com\/user\/webkul\/\"]},{\"@type\":\"Person\",\"@id\":\"https:\/\/webkul.com\/blog\/#\/schema\/person\/3a9d84d349b963ed99f7aead9372dd6d\",\"name\":\"Ayaz Mittaqi\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/webkul.com\/blog\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/9a683a7c995567db93858f0305606f73f9075f82330789701e3ed345f6f830aa?s=96&d=https%3A%2F%2Fcdnblog.webkul.com%2Fblog%2Fwp-content%2Fuploads%2F2019%2F10%2Fmike.png&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/9a683a7c995567db93858f0305606f73f9075f82330789701e3ed345f6f830aa?s=96&d=https%3A%2F%2Fcdnblog.webkul.com%2Fblog%2Fwp-content%2Fuploads%2F2019%2F10%2Fmike.png&r=g\",\"caption\":\"Ayaz Mittaqi\"},\"url\":\"https:\/\/webkul.com\/blog\/author\/ayaz-mittaqi024\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Adding Custom Mass Action In Admin Grid In Magento 2 - Webkul Blog","description":"How to add custom mass action in magento 2 grid?","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/webkul.com\/blog\/adding-custom-mass-action-in-admin-grid-in-magento-2\/","og_locale":"en_US","og_type":"article","og_title":"Adding Custom Mass Action In Admin Grid In Magento 2 - Webkul Blog","og_description":"How to add custom mass action in magento 2 grid?","og_url":"https:\/\/webkul.com\/blog\/adding-custom-mass-action-in-admin-grid-in-magento-2\/","og_site_name":"Webkul Blog","article_publisher":"https:\/\/www.facebook.com\/webkul\/","article_published_time":"2018-08-17T14:13:59+00:00","article_modified_time":"2024-02-28T10:21:50+00:00","og_image":[{"url":"https:\/\/webkul.com\/blog\/wp-content\/uploads\/2018\/08\/Screenshot_641.png","type":"","width":"","height":""}],"author":"Ayaz Mittaqi","twitter_card":"summary_large_image","twitter_creator":"@webkul","twitter_site":"@webkul","twitter_misc":{"Written by":"Ayaz Mittaqi","Est. reading time":"1 minute"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/webkul.com\/blog\/adding-custom-mass-action-in-admin-grid-in-magento-2\/#article","isPartOf":{"@id":"https:\/\/webkul.com\/blog\/adding-custom-mass-action-in-admin-grid-in-magento-2\/"},"author":{"name":"Ayaz Mittaqi","@id":"https:\/\/webkul.com\/blog\/#\/schema\/person\/3a9d84d349b963ed99f7aead9372dd6d"},"headline":"Adding Custom Mass Action In Admin Grid In Magento 2","datePublished":"2018-08-17T14:13:59+00:00","dateModified":"2024-02-28T10:21:50+00:00","mainEntityOfPage":{"@id":"https:\/\/webkul.com\/blog\/adding-custom-mass-action-in-admin-grid-in-magento-2\/"},"wordCount":115,"commentCount":2,"publisher":{"@id":"https:\/\/webkul.com\/blog\/#organization"},"image":{"@id":"https:\/\/webkul.com\/blog\/adding-custom-mass-action-in-admin-grid-in-magento-2\/#primaryimage"},"thumbnailUrl":"https:\/\/webkul.com\/blog\/wp-content\/uploads\/2018\/08\/Screenshot_641.png","articleSection":["magento","Magento2"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/webkul.com\/blog\/adding-custom-mass-action-in-admin-grid-in-magento-2\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/webkul.com\/blog\/adding-custom-mass-action-in-admin-grid-in-magento-2\/","url":"https:\/\/webkul.com\/blog\/adding-custom-mass-action-in-admin-grid-in-magento-2\/","name":"Adding Custom Mass Action In Admin Grid In Magento 2 - Webkul Blog","isPartOf":{"@id":"https:\/\/webkul.com\/blog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/webkul.com\/blog\/adding-custom-mass-action-in-admin-grid-in-magento-2\/#primaryimage"},"image":{"@id":"https:\/\/webkul.com\/blog\/adding-custom-mass-action-in-admin-grid-in-magento-2\/#primaryimage"},"thumbnailUrl":"https:\/\/webkul.com\/blog\/wp-content\/uploads\/2018\/08\/Screenshot_641.png","datePublished":"2018-08-17T14:13:59+00:00","dateModified":"2024-02-28T10:21:50+00:00","description":"How to add custom mass action in magento 2 grid?","breadcrumb":{"@id":"https:\/\/webkul.com\/blog\/adding-custom-mass-action-in-admin-grid-in-magento-2\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/webkul.com\/blog\/adding-custom-mass-action-in-admin-grid-in-magento-2\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/webkul.com\/blog\/adding-custom-mass-action-in-admin-grid-in-magento-2\/#primaryimage","url":"https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2018\/08\/Screenshot_641.png","contentUrl":"https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2018\/08\/Screenshot_641.png","width":"1198","height":"404"},{"@type":"BreadcrumbList","@id":"https:\/\/webkul.com\/blog\/adding-custom-mass-action-in-admin-grid-in-magento-2\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/webkul.com\/blog\/"},{"@type":"ListItem","position":2,"name":"Adding Custom Mass Action In Admin Grid In Magento 2"}]},{"@type":"WebSite","@id":"https:\/\/webkul.com\/blog\/#website","url":"https:\/\/webkul.com\/blog\/","name":"Webkul Blog","description":"","publisher":{"@id":"https:\/\/webkul.com\/blog\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/webkul.com\/blog\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/webkul.com\/blog\/#organization","name":"WebKul Software Private Limited","url":"https:\/\/webkul.com\/blog\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/webkul.com\/blog\/#\/schema\/logo\/image\/","url":"https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2021\/08\/webkul-logo-accent-sq.png","contentUrl":"https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2021\/08\/webkul-logo-accent-sq.png","width":380,"height":380,"caption":"WebKul Software Private Limited"},"image":{"@id":"https:\/\/webkul.com\/blog\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/webkul\/","https:\/\/x.com\/webkul","https:\/\/www.instagram.com\/webkul\/","https:\/\/www.linkedin.com\/company\/webkul","https:\/\/www.youtube.com\/user\/webkul\/"]},{"@type":"Person","@id":"https:\/\/webkul.com\/blog\/#\/schema\/person\/3a9d84d349b963ed99f7aead9372dd6d","name":"Ayaz Mittaqi","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/webkul.com\/blog\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/9a683a7c995567db93858f0305606f73f9075f82330789701e3ed345f6f830aa?s=96&d=https%3A%2F%2Fcdnblog.webkul.com%2Fblog%2Fwp-content%2Fuploads%2F2019%2F10%2Fmike.png&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/9a683a7c995567db93858f0305606f73f9075f82330789701e3ed345f6f830aa?s=96&d=https%3A%2F%2Fcdnblog.webkul.com%2Fblog%2Fwp-content%2Fuploads%2F2019%2F10%2Fmike.png&r=g","caption":"Ayaz Mittaqi"},"url":"https:\/\/webkul.com\/blog\/author\/ayaz-mittaqi024\/"}]}},"amp_enabled":true,"_links":{"self":[{"href":"https:\/\/webkul.com\/blog\/wp-json\/wp\/v2\/posts\/139236","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/webkul.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/webkul.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/webkul.com\/blog\/wp-json\/wp\/v2\/users\/116"}],"replies":[{"embeddable":true,"href":"https:\/\/webkul.com\/blog\/wp-json\/wp\/v2\/comments?post=139236"}],"version-history":[{"count":8,"href":"https:\/\/webkul.com\/blog\/wp-json\/wp\/v2\/posts\/139236\/revisions"}],"predecessor-version":[{"id":422461,"href":"https:\/\/webkul.com\/blog\/wp-json\/wp\/v2\/posts\/139236\/revisions\/422461"}],"wp:attachment":[{"href":"https:\/\/webkul.com\/blog\/wp-json\/wp\/v2\/media?parent=139236"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/webkul.com\/blog\/wp-json\/wp\/v2\/categories?post=139236"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/webkul.com\/blog\/wp-json\/wp\/v2\/tags?post=139236"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}