Select to view content in your preferred language

Emojis in labels not rendering correctly

1209
7
10-04-2023 11:49 AM
JonathanDandois
Frequent Contributor

Posting primarily for Field Maps, but I'm also having issues with the new Map Viewer.

I frequently use Arcade like this in Labels to show me whether an asset has been recently surveyed / visited, i use this in Pro, Portal, and Field Maps.

if (!IsEmpty($feature.Special_Status)) {
    if (IsEmpty($feature.Last_Verified)) {
        return "❌";
    } 
    else if (DateDiff($feature.Last_Verified, Date(2023, 08, 30), "days") < 0) {
        return "❌"
    } else {
        return "✅";
    }
}

The expected outcome is that features that meet the expression and have been recently surveyed, as noted by a current "Last_Verified" date, will show a green check emoji   U+2705. whereas features that have not been surveyed (old date or no date) get a red X emoji  U+274C. This works great in Pro and in Portal Web Map Classic, as below in first screen.

Emoji labels working in Portal WebMapEmoji labels working in Portal WebMap

But in field maps the render is different. the colors are tied to the color of the label text configured in the Web Map Classic and the check box emoji only renders as a block.

Emoji labels not working in Field MapsEmoji labels not working in Field Maps

When using new Map Viewer, the emojis don't appear at all.

emoji labels absent in Portal new Map Vieweremoji labels absent in Portal new Map Viewer

I'm aware that emoji rendering depends a lot on the device, the fonts, etc, but couldn't find anything specific about this issue. 

Realize there are other ways to symbolize based on attribute status, but using labels is so easy and I don't have to have lots of symbol styles or go deep into Dictionary Symbology.

iOS Field Maps v23.2.3 | Enterprise Portal 10.9.1

7 Replies
DougBrowning
MVP Esteemed Contributor

I have no idea if it would work in the map viewer in labels but in Dashboards we use SVGs instead now.  It may work for you?

https://doc.arcgis.com/en/dashboards/latest/create-and-share/use-custom-icons.htm

https://www.esri.com/arcgis-blog/products/arcgis-online/mapping/do-more-with-symbols-in-map-viewer-b... 

I wonder how offline affects both of these though?

0 Kudos
JustinReynolds
Frequent Contributor

Hey Jonathan,

Have you tried using FromCharCode(code) Arcade function?  The number the function takes is the decimal representation of the emoji or any character.  I tried this in a popup it works okay, but it may or may not translate to your labels

 

 

FromCharCode(9989) // check mark
FromCharCode(10060) // cross mark

 

 

- Justin Reynolds, PE
JonathanDandois
Frequent Contributor

Hi Justin, that sounds like a great idea, but it looks like that function is only available at Enterprise 11.0 and im at 10.9.1  https://developers.arcgis.com/arcade/function-reference/text_functions/#fromcharcode, 

so, more hacks for now.  i guess your answer is the solution, ill mark it as such so you get those sweet magic internet points. 

 

0 Kudos
JustinReynolds
Frequent Contributor

I appreciate that, but you may want to roll back on my post being the solution.  I did a little more exploration here. While the emojis render fine in a popup, they definitely do not work in labels in map viewer or Field maps.  I tested this in AGOL and FM Android and iOS.

- Justin Reynolds, PE
0 Kudos
JonathanDandois
Frequent Contributor

lol, i guess i should have tested it myself! good thing there is a "Not the Solution" button.  You can keep the kudos though. to be continued....

DougBrowning
MVP Esteemed Contributor

Have you tried just using your code in the Symbology?  it takes Arcade now.

DougBrowning_0-1696516118240.png

 

0 Kudos
JonathanDandois
Frequent Contributor

Yes and i think that's the best fallback.  I've been using this label and emoji hack kind of like a Dictionary Symbology, so instead of defining the unique symbol per condition set, i just set the broad rules.  To do what I'd need to do in the current map I'd have to have 4 unique symbols, whether by Arcade in the Web Map Symbology or by publishing in Pro with multiple Unique Value fields. 

JonathanDandois_0-1696522952074.png

 

 

0 Kudos