Mailing Labels Custom Widget

1142
16
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 

End User Interaction 


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:

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

Improvements and Enhancements for User Group

These are potential areas of improvement and ideas that could be explored in future updates, and are open to feedback and suggestions from the Esri Community:

  • Display buffer area vs originally drawn area from selection tools.

Attachments
Comments
Brian_McLeer
Frequent 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
Frequent 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
Frequent 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
Frequent 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
Frequent 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
Frequent 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

 

CamMiller17
Occasional Contributor

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

Brian_McLeer
Frequent 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
Frequent 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. 

Version history
Last update:
‎08-26-2025 02:46 PM
Updated by:
Contributors