Select to view content in your preferred language

How to Underline and Change Text Font Size when Creating Arcade Attribute Expression in Map Viewer Pop-Up?

80
2
Jump to solution
Tuesday
ChristopherBowering
Frequent Contributor

I am creating an Arcade attribution express to use in Text content in a pop-up configuration.  I would like to underline and change the font size of the title (normal text).  I am imitating the many examples I've seen online but the attribute expression (attempting underline, only, first) just shows this:

ChristopherBowering_0-1759861326676.png

Below is the code I am using

Var Fields = [
  "ID: " + $feature.COID + TextFormatting.NewLine,
  "Damage Present: " + $feature.DAMAGE
];

If (DomainName($feature, 'FLOW') == 'No') {
  return "<UND>" + "Title" + "</UND>" + TextFormatting.NewLine + Concatenate(Fields);
} else {
  return $feature.WEATHER24;
}

 

Any thoughts??

 

Thanks!

0 Kudos
1 Solution

Accepted Solutions
MarkBockenhauer
Esri Regular Contributor

Perhaps you could use an Arcade popup element and use HTML tags.

Something like 

Var Fields = [
  "ID: " + $feature.COID + '<br>',
  "Damage Present: " + $feature.DAMAGE
];
var vTitle = ''
If (DomainName($feature, 'FLOW') == 'No') {
    vTitle = '<u>Title</u><br>' + Concatenate(Fields)
}else {
    vTitle = $feature.WEATHER24
}

return { 
	type : 'text', 
	text : vTitle //this property supports html tags 
}

 

View solution in original post

0 Kudos
2 Replies
MarkBockenhauer
Esri Regular Contributor

Perhaps you could use an Arcade popup element and use HTML tags.

Something like 

Var Fields = [
  "ID: " + $feature.COID + '<br>',
  "Damage Present: " + $feature.DAMAGE
];
var vTitle = ''
If (DomainName($feature, 'FLOW') == 'No') {
    vTitle = '<u>Title</u><br>' + Concatenate(Fields)
}else {
    vTitle = $feature.WEATHER24
}

return { 
	type : 'text', 
	text : vTitle //this property supports html tags 
}

 

0 Kudos
ChristopherBowering
Frequent Contributor

Thank you very much!  I had thought about involving HTML but wasn't sure how to incorporate it.  Your modification works great.  I added a couple more components to change the font and color as well.

 

Var Fields = [
  "ID: " + $feature.COID + '<br>',
  "Damage Present: " + $feature.DAMAGE
];
var vTitle = ''
If (DomainName($feature, 'FLOW') == 'No') {
    vTitle = '<span style="font-family: Times New Roman, serif; font-size: 20px; color: #8c0122"><b><u>Title</u></b><br></span>' + Concatenate(Fields)
}else {
    vTitle = $feature.WEATHER24
}

return { 
	type : 'text', 
	text : vTitle //this property supports html tags 
}

 

0 Kudos