Mailing Labels Custom Widget

8066
44
05-28-2025 07:41 AM

Mailing Labels Custom Widget

Mailing Label Widget Overview

This widget is designed to enhance mailing label management within the ArcGIS Experience Builder ecosystem. It offers seamless integration with map layers, advanced selection and drawing tools, and supports multiple label output formats including CSV and PDF.

Note: Requires install of jsPDF on client folder, running npm install jspdf

Note: Input service needs to be a Feature Layer (editing capabilities not required)

Developer Edition Configuration 

(view in My Videos)

End User Interaction 

(view in My Videos)


What Can This Widget Do?

Original capabilities (from core logic):

  • Select and configure map layers to use as data sources for labels.

  • Map fields to specific mailing fields (name, address, city, state, zip).

  • Draw shapes (point, polyline, polygon, rectangle, circle) to select areas for labels.

  • Generate labels in CSV and PDF formats with customizable label templates (Avery 5160–5164).

  • Font size options for printed labels.

  • Automatically disables Esri’s popups and highlights while active to focus on drawing and selection.

  • Clear selection areas and restore map behavior when the widget is closed.

Enhanced capabilities in this version:

  • Dynamic field mapping options that populate from selected layers.

  • Buffering options (distance and unit) for drawn geometries to expand selection areas.

  • Clear selection graphics and highlight management with fallback visualizations for feature selection.

  • Responsive label previews and customizable font size and label formats.

  • Error handling and messaging for failed queries or drawing operations.

  • Map view and layer management to handle disconnected or delayed map loading gracefully.

  • Interactive user messages (success, warning, error) displayed for actions like selection, generation, or errors.


Configuration Options

  • Map Widget Selection: Choose the map widget to connect to.

  • Layer and Field Mapping: Select a feature layer and assign fields to mailing label fields.

  • Geometry Selection: Enable selection by click, draw, or both; configure a buffer for drawn areas.

  • Label Format and Font: Choose from multiple Avery formats and set the font size.

  • Output Options: Generate mailing labels as CSV or open a print-ready PDF.

Changelog:

04/03/2026:

  • Implement idea from @AmyDuquesnoy about being able to add remove a selected feature after original selection area is drawn.

    Brian_McLeer_0-1775242675858.png

     

02/24/2026:

  • Integrate to grab selection from Custom Draw widget and pass to mailing labels (can be enabled/disabled in settings), See video at Advanced Draw Widget 

02/12/2026:

  • Had a call come in from a realtor asking if they could select multiple parcels using a multipoint selection. Added multipoint selection as a pick option. 

    Brian_McLeer_0-1770935414572.png

02/02/2026:

  • No longer maintaining 1.18 version.

  • Show original graphic vs buffer in different colors

  • Add option to widget to remove duplicates and empty records (both on by default)
Brian_McLeer_0-1770070625424.png

12/10/2025 (for 1.19 version only):

  • Theme Typography Update – All widget text now uses Experience Builder’s Theme Typography for consistent styling.

  • Accessibility Improvements – Added multiple WCAG-compliant updates across widgets for better usability and accessibility.

11/13/2025: Breaking changes between Developer Edition 1.18 and 1.19:

Upgrading ArcGIS Experience Builder Widgets from 1.18 to 1.19: Breaking Changes

Experience Builder 1.19 introduces two critical breaking changes that prevent widgets built for 1.18 from loading. First, the WidgetState enum has been removed from 'jimu-core', requiring developers to replace WidgetState.Opened with the string literal "OPENED" in widget lifecycle methods. Second, and more significantly, the jsx() function signature has changed to align with React 17+'s new JSX transform—children must now be passed as a children property within the props object rather than as separate function arguments. This means jsx('div', {props}, child1, child2) must be rewritten as jsx('div', {props, children: [child1, child2]}) throughout the entire render method. Every jsx call in your widget needs updating, with all child elements explicitly specified in the children prop (e.g., jsx('h2', { style: {...}, children: 'Title' })). While this is a substantial refactoring effort, it brings Experience Builder in line with modern React standards and is a one-time migration requirement for the 1.18 to 1.19 upgrade path.

I have posted both a 1.18 and a 1.19 version in this update to work on both versions. 

10/14/2025: Resolved BUG integrating widget in Experience that uses multiple maps. 

08/01/2025: Enhanced address type management and UI adaptation

  • Added dual address type support: Widget now supports both Physical Mailing Address and Owner Address configurations with separate field mappings and optional separate data layers
  • Added conditional UI display: Radio button selection automatically hides when only one address type is enabled in settings, providing a cleaner single-purpose interface
  • Added automatic selection clearing: When switching between address types, any existing selections are automatically cleared to prevent data confusion, with user notification

07/23/2025: Tested widget on Developer Edition 1.18 that was released on 7/23/25 and widget functions as normal. 

06/12/2025: Resolved bug that allowed for selection of up to 2,000 records but downloaded only 500. Limit now is 2,000 for both selection and CSV/PDF download. 

05/28/2025: Automatic PDF Downloads with Smart Naming

 

Attachments
Comments
Brian_McLeer
MVP Regular Contributor

07/23/2025: Tested widget on Developer Edition 1.18 that was released on 7/23/25 and widget functions as normal. 

Brian_McLeer
MVP Regular Contributor

08/01/2025: Enhanced address type management and UI adaptation

  • Added dual address type support: Widget now supports both Physical Mailing Address and Owner Address configurations with separate field mappings and optional separate data layers
  • Added conditional UI display: Radio button selection automatically hides when only one address type is enabled in settings, providing a cleaner single-purpose interface
  • Added automatic selection clearing: When switching between address types, any existing selections are automatically cleared to prevent data confusion, with user notification
MarieWhibley
Occasional Explorer

@Brian_McLeer 

Do you plan to have the widget work with related tables? We store our mailing information in a related table linked to our parcel layer and your widget would work great for us!

Brian_McLeer
MVP Regular Contributor

@MarieWhibley I don't have any plans for that, right now it only functions with feature layers. Are you able to publish the related table as a feature layer to Portal as a workaround? 

DominicChavez
New Explorer

@Brian_McLeer 

Thanks for creating this widget. It’s been really useful!

Will the widget be able to take a selected feature, create a buffer around it (for example, 250ft), and then use that buffer as a boundary to select intersecting features from any layer the user chooses?

For example, if I select a road segment and buffer it by 250ft, could I then use that buffer to find all parcels or buildings that fall within that area?

Brian_McLeer
MVP Regular Contributor

Thank you @DominicChavez. The widget does not interact with other map features, it only interacts with the drawn graphic. You can either select parcels for example with just the drawn graphic or by applying a buffer to the drawn graphic.  

CamMiller17
Occasional Contributor

@Brian_McLeer  Thank you for making this widget. I am currently on version 1.18 and it is getting a fail to load once I publish or even preview it. Would you have any reason on why this is occurring?

CamMiller17_0-1758891988356.png

CamMiller17_0-1758895299922.png

 

 

Brian_McLeer
MVP Regular Contributor

@CamMiller17 confirming that you installed jsPDF via the command npm install jspdf on the client folder? 

CamMiller17
Occasional Contributor

@Brian_McLeer Yes it is installed, the errors look like its coming from the right click widget. Even though I deleted it and getting the same error, failure to load.

It does appear when I am editing the web experience but when I preview it or publish it out, thats when it fails to load

 

 

Brian_McLeer
MVP Regular Contributor

Thank you @CamMiller17 , allow me some time to research and troubleshoot. If you can post a screen recording of of the issue, that would be very helpful. I use OBS Studio as an open source screen recording tool for videos if that helps. 

JeffreyThompson2
MVP Frequent Contributor

Hey @Brian_McLeer did you remember to include jimu-arcgis as a dependency in the manifest.json? Not having it can cause exactly this kind of intermittent error.

"dependency": [
  "jimu-arcgis"
]
CamMiller17
Occasional Contributor

@Brian_McLeer Reloading video since it was picking up audio from teammate's video

(view in My Videos)

 

CamMiller17
Occasional Contributor

@Brian_McLeer If I have it outside of my section sidebar, it works and loads

Brian_McLeer
MVP Regular Contributor

@JeffreyThompson2 yes to the mailing labels widget, no to the right click widget for the below snippet. 

"dependency": [
  "jimu-arcgis"
]

 @CamMiller17 I updated the ZIP on the right click widget to include this, can you update your right click widget with this version and let me know if the issue persists? 

CamMiller17
Occasional Contributor

@Brian_McLeer I am not getting any errors for my right click at all.

The mailing labels widget is still not working when it is nested in my sidebar within a section. If I have it floating in the map or even as a button, it works perfectly.

CamMiller17_0-1758904541456.png

 

Brian_McLeer
MVP Regular Contributor

Thank you @CamMiller17. I will create a testing application like the setup you have and try to replicate the issue. From there, I will troubleshoot what might be causing it to fail when it is nested in a sidebar within a section. It might not be until early next week when I can look into it. 

DominicChavez
New Explorer

Greetings @Brian_McLeer,

I do not know if this helps or is most likely a separate thing but when I add the widget into an experience builder with two maps, it runs into a timeout error. 

2 Maps Widget Error.png
The image above contains a contrived minimal setup but reflects the same situation in one of the apps we are using the Mailing Label widget in.

Brian_McLeer
MVP Regular Contributor

@DominicChavez I just updated the ZIP download to resolve your bug, please let me know if the issue persists for you. 

@CamMiller17 I was never able to replicate your issue, I sent you a message on Esri Community if you can please check that. Also this updated version may resolve your issue if you can please review.

DominicChavez
New Explorer

@Brian_McLeer I have done a bit of testing. It appears when the widget searches for a map, it resolves. However, upon experimenting with it a bit more, it resolves to whatever map appears in some order. (In this case, from left to right with left taking priority over the right). I have attached images as references to both scenarios to illustrate this. LM being 'Light Map' and DM being 'Dark Map'. I could send dev tools console logs if that helps (not sure exactly how that would work in this medium).

Also, new look and updated features are great!

DM - LM Setup.png

LM - DM Setup.png

CamMiller17
Occasional Contributor

@Brian_McLeer  Thank you again for this mailing labels custom widget! The new zip is working amazing! I was wondering if there was a way to create a CSV for both the physical and mailing addresses. It would be beneficial for creating assessment rolls!

JasonBOCQUET
Frequent Contributor

Hi I have a question : this widget can be used to be a replacement of "Export" action on widgets ? I mean using the CSV export function. Or it's too limited by the map selection ?

Brian_McLeer
MVP Regular Contributor

Thank you @DominicChavez, when I get a chance I will try to create an app on my end to test and see if I can replicate the issue. I might reach out if I need further info. 

@CamMiller17 thank you! Are you referring to adding third function to create both for a CSV export for both physical and owner, then the CSV would have two sheets within the file for both types? If so, this would probably not be feasible for the PDF aspect but perhaps the CSV aspect. 

@JasonBOCQUET To my knowledge it cannot, but perhaps some further development with the source code you might be able to.

CamMiller17
Occasional Contributor

@Brian_McLeer Yes for the CSV option. If could be one sheet or even 2 sheets would be amazing.

JeffreyThompson2
MVP Frequent Contributor

@Brian_McLeer May I propose an enhancement/alternate version that uses the output DataSource from Near Me as the input for the Mailing Labels?

Brian_McLeer
MVP Regular Contributor

Thank you for the enhancement ideas @CamMiller17 and @JeffreyThompson2 , I will look to add these in a near term update.

Brian_McLeer
MVP Regular Contributor

11/13/2025: Breaking changes between Developer Edition 1.18 and 1.19:

Upgrading ArcGIS Experience Builder Widgets from 1.18 to 1.19: Breaking Changes

Experience Builder 1.19 introduces two critical breaking changes that prevent widgets built for 1.18 from loading. First, the WidgetState enum has been removed from 'jimu-core', requiring developers to replace WidgetState.Opened with the string literal "OPENED" in widget lifecycle methods. Second, and more significantly, the jsx() function signature has changed to align with React 17+'s new JSX transform—children must now be passed as a children property within the props object rather than as separate function arguments. This means jsx('div', {props}, child1, child2) must be rewritten as jsx('div', {props, children: [child1, child2]}) throughout the entire render method. Every jsx call in your widget needs updating, with all child elements explicitly specified in the children prop (e.g., jsx('h2', { style: {...}, children: 'Title' })). While this is a substantial refactoring effort, it brings Experience Builder in line with modern React standards and is a one-time migration requirement for the 1.18 to 1.19 upgrade path.

I have posted both a 1.18 and a 1.19 version in this update to work on both versions. 

PatWalker
Emerging Contributor

Great job on the Mailing Widgets for V118 and 119, all works great.  Thank you for your work on this.

Pat Walker

Brian_McLeer
MVP Regular Contributor

12/10/2025 (for 1.19 version only):

  • Theme Typography Update – All widget text now uses Experience Builder’s Theme Typography for consistent styling.

  • Accessibility Improvements – Added multiple WCAG-compliant updates across widgets for better usability and accessibility.

KevinHitchcock
Emerging Contributor

This is so great! Thank you @Brian_McLeer . This is one of the last remaining sticking points for migrating from WAB for our internal application. It works really well. Forcing users to a seperate Instant App/login credentials wasn't going to be popular. 

 

In WAB there was an option to remove duplicates, it would be really nice to have that.

 

I also like in the Public Notification Instant App it reduces the font size to fit the text in the label template boxes. WAB didn't do that. It's nice yours has the font size selector and that works too but it would be helpful to not have to reduce the size for all labels because of a couple extra wordy ones.

Brian_McLeer
MVP Regular Contributor

Thank you @KevinHitchcock for the positive feedback. I can look at adding the 2 enhancement requests down the road. I can in particular see the remove duplicates as being useful. 

Brian_McLeer
MVP Regular Contributor

02/02/2026:

  • No longer maintaining 1.18 version.

  • Show original graphic vs buffer in different colors

  • Add option to widget to remove duplicates and empty records (both on by default)

Brian_McLeer_0-1770072049338.png

 

 

Brian_McLeer
MVP Regular Contributor

02/12/2026:

  • Had a call come in from a realtor asking if they could select multiple parcels using a multipoint selection. Added multipoint selection as a pick option. 

    Brian_McLeer_0-1770935469318.png

     

Brian_McLeer
MVP Regular Contributor

02/24/2026:

  • Integrate to grab selection from Custom Draw widget and pass to mailing labels (can be enabled/disabled in settings), See video at Advanced Draw Widget 

ewilde
by
New Contributor

Thank you for this widget Brian! Hopefully we can now upgrade from WAB to Experience Builder. 

I am having some trouble with the PDF labels. I get an error that says: PDF generation failed. Please try CSV export instead. 

CSV export works fine. Just wondering if you have come across this?

Thank you!  

Brian_McLeer
MVP Regular Contributor

Hello @ewilde,  would you be able to send any browser console logs when trying to do the PDF output to see if it gives errors or warnings?

ewilde
by
New Contributor
Hi Brian,
It is working fine today and I didn’t change anything? Maybe my computer needed a nap. 😊
Again, thank you for your widget and your time.
Brian_McLeer
MVP Regular Contributor

Thanks @ewilde , glad its working for you! 

AmyDuquesnoy
New Contributor

This is a great tool. Has there been any thought to add a function to remove a parcel/polygon that you had accidentally selected instead of having to clear all and start over?

Brian_McLeer
MVP Regular Contributor

Thank you @AmyDuquesnoy. I can look at adding this sometime in the near future. 

Brian_McLeer
MVP Regular Contributor

04/03/2026:

  • Implement idea from @AmyDuquesnoy  about being able to add remove a selected feature after original selection area is drawn.

    Brian_McLeer_0-1775242710211.png

     

PatWalker
Emerging Contributor

Brian,

    Thanks for your great work, we use this mailing widget alot.  Will this be compatible with Exp Bldr Dev V1.20?  Thanks again.

Brian_McLeer
MVP Regular Contributor

Thank you @PatWalker, yes, I am currently using DE 1.20. This widget did not break like some other ones going from 1.19 to 1.20. 

JhonGalindo
New Explorer

I really like this implementation, @Brian_McLeer . I consider it a great contribution.

I was reviewing the code and was wondering what the best way would be to help with the development of the tool.

Are you considering uploading the widget to GitHub so others can submit pull requests and propose improvements to the code?

Thank you very much for your help.

 

Brian_McLeer
MVP Regular Contributor

Thank you @JhonGalindo. I have considered this and see the benefit. At this point I don't have plans in the near term as my day to day projects have shifted from migration to EB and widget development to other unrelated EB tasks. 

Version history
Last update:
a month ago
Updated by:
Contributors