How To Configure Avery 5160 Mailing Lists

Mailing lists are configured in the Map Viewer for each layer via the Custom Popup.  In this example, we will create an Avery Mailing List from Maricopa County parcel data.

This is our base data to work with:

In the pop-up properties for this feature, we will be adding Arcade content to tell the xbUI Widget how to handle the layers

Replace the default content in the editor with the following text:

{
    “type” : “XBTOOLS”,
    “exporttemplate”: [
      { “category”: “PDF”, “type”: “MAP”, “name”: “Map Only”, “outputfile”: “MapOnly.pdf”, “title”: “Map title set in template” },
      { “category”: “PDF”, “type”: “ATT”, “name”: “Attributes Only”, “outputfile”: “Attributes.pdf”, “title”: “Map title set in template” },
      { “category”: “PDF”, “type”: “AVERY”, “name”: “Avery Labels”, “outputfile”: “MailingList.pdf”,
        “layout”:
        {
            “marginleft”: 0.15, “margintop”: 0.6, “fontheight”: 10, “showborder”: true, “indent”: 0.125,
            “content”: [
                { “type”: “text”, “text”: “Current Occupant”, “default”: “”, “justification”: “left” },
                { “type”: “text”, “text”: “$feature.si_street_num + ‘ ‘ + $feature.si_street_dir + ‘ ‘ + $feature.si_street_name + ‘ ‘ + $feature.si_street_suffix“, “shownull”: false, “justification”: “left” },
                { “type”: “text”, “text”: “IIf($feature.si_suite == null, ”, ‘Suite’ + TextFormatting.ForwardSlash + ‘Unit: ‘ + $feature.si_suite)“, “justification”: “left”, “shownull”: false  },
                { “type”: “text”, “text”: “$feature.si_city +’, ‘+ ‘AZ’ +’ ‘+ $feature.si_zip“, “justification”: “left” }
            ]
        }
      }
    ]
}

The bold will be replaced with your own Arcade statements

Note that the statement is enclosed with “”.  Statements should be tested to be sure it is a value Arcade script.  One way to do this is to leverage the Attribute Expression editor located here:

In this example, we’ve tested the statement using the Run button, once the statement is validated, copy the script to the xbTools script.

  1. Note that each object of the “content” array represents a line in the output label.  The first line simply pushed out “Current Occupant” and will not be processed as an Arcade statement
  2. The 3rd line has a conditional IIF statement that tests the status of $feature.si_suite, if it is null, it will return null and together with the “shownull” being false, the line will not show on the label.
  3. Each line has a “justification” and will honor that for each line, allowing you to change from ‘left’, ‘center’ or ‘right’.
  4. Future enhancements will include bold, italic and colors
  5. The greyed out lines are for development and are not yet fully tested.
  6. “Showborder” is not intended to be true for production, it is used to ensure alignment is correct and should be set to false.

Once the configuration is complete, reload the page to ensure the widget has the most complete information.  The options will show on the menu selection as follows (previous versions had a popup dialog):

2 responses to “How To Configure Avery 5160 Mailing Lists”

  1. Dave G Avatar
    Dave G

    With the 0.6.13 version of XBTools, should the Avery Labels arcade expression conditional statement work as stated above ( “IIf($feature.si_suite == null, ”, ‘Suite’ + TextFormatting.ForwardSlash + ‘Unit: ‘ + $feature.si_suite)“ )? I know we discussed this earlier, but not sure what the latest status is. When I use this line it is simply printed as a string in the label:

    BOB SMITH
    IIf($feature.NAME2 ==
    null, ”, $feature.NAME2)
    2222 MAIN ST
    CLARKSTON, MI 48346 3460

    Here is my arcade expression:
    “layout”:
    {
    “marginleft”: 0.15, “margintop”: 0.6, “fontheight”: 10, “showborder”: true, “indent”: 0.125, “maxcharacters”: 26, “distinct”: true,
    “content”: [
    { “type”: “text”, “text”: “$feature.NAME1”, “default”: “Current Occupant”, “justification”: “left”, “maxlines”: 2, “bold”: true },
    { “type”: “text”, “text”: “IIf($feature.NAME2 == null, ”, $feature.NAME2)”, “justification”: “left”, “maxlines”: 2, “bold”: true, “shownull”: false },
    { “type”: “text”, “text”: “$feature.SITEADDRESS”, “shownull”: false, “justification”: “left” },
    { “type”: “text”, “text”: “$feature.SITECITY+’, ‘+$feature.SITESTATE+’ ‘+$feature.SITEZIP5+’ ‘+$feature.SITEZIP4”, “shownull”: false, “justification”: “left” }
    ]
    }

    Thanks

    1. Dave G Avatar
      Dave G

      Disregard previous post. It is now working, although not sure exactly what fixed it. Maybe there were some hidden characters copied in that I took care of with edits(??) Here is my arcade expression that is now working:

      “layout”:
      {
      “marginleft”: 0.15, “margintop”: 0.6, “fontheight”: 10, “showborder”: true, “indent”: 0.125, “maxcharacters”: 26, “distinct”: true,
      “content”: [
      { “type”: “text”, “text”: “$feature.NAME1”, “default”: “Current Occupant”, “justification”: “left”, “maxlines”: 2, “bold”: true },
      { “type”: “text”, “text”: “IIf($feature.NAME2 == null, ”, $feature.NAME2)”, “justification”: “left”, “maxlines”: 2, “bold”: true },
      { “type”: “text”, “text”: “$feature.POSTALADDRESS”, “shownull”: false, “justification”: “left” },
      { “type”: “text”, “text”: “$feature.POSTALCITY+’, ‘+$feature.POSTALSTATE+’ ‘+$feature.POSTALZIP5+’ ‘+$feature.POSTALZIP4”, “shownull”: false, “justification”: “left” }
      ]
      }

      Thanks!

Leave a Comment

Your email address will not be published. Required fields are marked *

2 thoughts on “How To Configure Avery 5160 Mailing Lists”

  1. With the 0.6.13 version of XBTools, should the Avery Labels arcade expression conditional statement work as stated above ( “IIf($feature.si_suite == null, ”, ‘Suite’ + TextFormatting.ForwardSlash + ‘Unit: ‘ + $feature.si_suite)“ )? I know we discussed this earlier, but not sure what the latest status is. When I use this line it is simply printed as a string in the label:

    BOB SMITH
    IIf($feature.NAME2 ==
    null, ”, $feature.NAME2)
    2222 MAIN ST
    CLARKSTON, MI 48346 3460

    Here is my arcade expression:
    “layout”:
    {
    “marginleft”: 0.15, “margintop”: 0.6, “fontheight”: 10, “showborder”: true, “indent”: 0.125, “maxcharacters”: 26, “distinct”: true,
    “content”: [
    { “type”: “text”, “text”: “$feature.NAME1”, “default”: “Current Occupant”, “justification”: “left”, “maxlines”: 2, “bold”: true },
    { “type”: “text”, “text”: “IIf($feature.NAME2 == null, ”, $feature.NAME2)”, “justification”: “left”, “maxlines”: 2, “bold”: true, “shownull”: false },
    { “type”: “text”, “text”: “$feature.SITEADDRESS”, “shownull”: false, “justification”: “left” },
    { “type”: “text”, “text”: “$feature.SITECITY+’, ‘+$feature.SITESTATE+’ ‘+$feature.SITEZIP5+’ ‘+$feature.SITEZIP4”, “shownull”: false, “justification”: “left” }
    ]
    }

    Thanks

    1. Disregard previous post. It is now working, although not sure exactly what fixed it. Maybe there were some hidden characters copied in that I took care of with edits(??) Here is my arcade expression that is now working:

      “layout”:
      {
      “marginleft”: 0.15, “margintop”: 0.6, “fontheight”: 10, “showborder”: true, “indent”: 0.125, “maxcharacters”: 26, “distinct”: true,
      “content”: [
      { “type”: “text”, “text”: “$feature.NAME1”, “default”: “Current Occupant”, “justification”: “left”, “maxlines”: 2, “bold”: true },
      { “type”: “text”, “text”: “IIf($feature.NAME2 == null, ”, $feature.NAME2)”, “justification”: “left”, “maxlines”: 2, “bold”: true },
      { “type”: “text”, “text”: “$feature.POSTALADDRESS”, “shownull”: false, “justification”: “left” },
      { “type”: “text”, “text”: “$feature.POSTALCITY+’, ‘+$feature.POSTALSTATE+’ ‘+$feature.POSTALZIP5+’ ‘+$feature.POSTALZIP4”, “shownull”: false, “justification”: “left” }
      ]
      }

      Thanks!

Leave a Comment

Your email address will not be published. Required fields are marked *

Scroll to Top