Feature Label - conditional statement?
Hello,
Is it possible to somehow have a "conditional statement" in the Feature Label?
Current feature label: Address: {FULLADDRESS} {UNIT} --- which would end up with "206 S Main St 502"
Ultimately, I would like it to read 206 S Main St Suite 502 where UNITTYPE holds the value "Suite" where there is a UNIT. If Unit doesn't exist, the UNITTYPE field holds "N/A"
I need something like {FULLADDRESS} "if {UNITTYPE} = 'N/A' then display {UNITTYPE}, else do not display {UNITTYPE} field" {UNIT}
Is this possible in the Feature Label ? I want to avoid having to alter the underlying database
Thanks,
Carmen
0
-
Hi Carmen,
That is an improvement request (GE-2380) that will not be implemented. You can however try and use custom CSS to help. Here is an example that was provided for hiding a blank phone number :
What you can do is add the following CSS selector to your Custom/Desktop.css (and others if desired):
div[layerDescVal=""]
{ display:none; }
Then, in the HTML for your feature description and/or feature long description, do something like the following:
<div layerDescVal="
{Phone}"><span>Phone:</span><span>{Phone}
</span></div>
When the phone number is blank, it will be hidden.
Regards,
Wayne Richard
Latitude Geographics Group Ltd.
Head Office: 300 – 1117 Wharf Street Victoria, BC Canada V8W 1T7
Tel: (250) 381-8130 | Fax: (250) 381-8132 | wrichard@latitudegeo.com
Developers of Geocortex web-based mapping software | www.geocortex.com
An Esri Platinum Business Partner0 -
That's really cool, and I'm assuming it would apply to all blank values?
If for some reason you wanted to target that specific layer, you could also use a one to one data link to generate the label on the fly. Something like this:
SELECT
CASE
WHEN UNITTYPE <> 'NA' THEN [FULLADDRESS] + ' ' + [UNITTYPE] + ' ' + [UNIT]
ELSE [FULLADDRESS]
END AS FullAddress
FROM YourTable
WHERE YourID = @Id0
Bitte melden Sie sich an, um einen Kommentar zu hinterlassen.
Kommentare
2 Kommentare