Select to view content in your preferred language

Text is not formatting correcting in conditional statement

242
1
Jump to solution
06-04-2024 06:30 AM
Labels (3)
GeorgeJonesRIGOV
New Contributor II

Hello, I'm trying to format the following to have the feature value to show up as a red text. However, AGOL wont recognize this (as seen in the attachment).

the source code is as follows: 

else if (time >= Date(2024, 05, 01) && time < Date(2024, 06, 01))  {           //This is june-month's are zero based
return "<CLR red='255'>" +$feature["JUNE"] + "</CLR>" + ' ' + TextFormatting.NewLine + ' As of: ' + time3;

} else if ....

Any advice?

 

thank you, Georgeclr_text_confusion.png

0 Kudos
1 Solution

Accepted Solutions
KenBuja
MVP Esteemed Contributor

Unfortunately, AGOL does not recognize the formatting tags used in ArcGIS Pro. If this for a popup, you can use an Arcade element with html tags like this

var output = `This is <span style="color:red">red</span> text`

return { 
	type : 'text', 
	text : output
}

which gives you a popup like this

Snag_7f8dcf.png

View solution in original post

1 Reply
KenBuja
MVP Esteemed Contributor

Unfortunately, AGOL does not recognize the formatting tags used in ArcGIS Pro. If this for a popup, you can use an Arcade element with html tags like this

var output = `This is <span style="color:red">red</span> text`

return { 
	type : 'text', 
	text : output
}

which gives you a popup like this

Snag_7f8dcf.png