Select to view content in your preferred language

Arcade Expresssion

120
2
2 weeks ago
Labels (1)
FranHarvey2
New Contributor III

We have a field name:  valve service SDE.  The attributes are either "null" or a "url"  We have a working expression for the url to be returned.  We need an expression for when the attribute is "null"  return the text  "No Service Card"

Tags (1)
0 Kudos
2 Replies
CodyPatterson
Regular Contributor

Hey @FranHarvey2 

Here is a short arcade script that does just that if your feature is in this format:

var service = $feature.valve_service_SDE;

if (IsEmpty(service)) {
    return "No Service Card";
} else {
    return service;
}

Hope that helps!

Cody

jcarlson
MVP Esteemed Contributor

There's also DefaultValue, which was made for this very thing. If there's a value, it returns, otherwise it falls back to the value you specify.

jcarlson_0-1722629601202.png

jcarlson_1-1722629630262.png

 

- Josh Carlson
Kendall County GIS