Hi,
I have two fields 'accom' and 'accom_url'.
I am trying to write an arcade expression that will check my table to see if 'accom' exists. If empty, then my pop-up will be empty.
If 'accom' exists but not 'accom_url' then 'accom' text will be placed in pop-up.
If 'accom' exists and 'accom_url' exist, then my pop-up will 'accom' text with hyperlink enabled.
Regards,
Craig
Take a look at the following post https://community.esri.com/thread/237247-arcade-expression-ifthen-statement which outlines using conditional statements with or/and operators in Arcade. If you post the Arcade code that you have so far, I would be glad to respond with additional guidance.
Lance,
I have the following:
Accomoodation
IIf(isEmpty($feature.Accommod_1),"", $feature.Accommod_1)
Accommodation URL
IIF (isEmpty($feature.Accom_URL),"",$feature.Accom_URL)
Working as expected. My problem is having the following occur in the pop-up:
Attribute | Values | No Values |
---|---|---|
Accommodation | Yes - Display | No - Don't display |
Accommodation + Accommodation URL | Yes for both - Display information and associated URL hyperlink | No for both - Don't display |
If I 'set' the URL in the pop-up code using the expression and there is no URL for the 'Accommodation' information, a URL back to the webmap creates a blank return.
Ideally, my Arcade expression and custom pop-up code will be able to show according to the above table if possible.
Regards,
Craig
Craig,
You can try something like the following. You will need to adjust the logic, return strings and add any HTML wrapping as needed but gives you an example.
if (isEmpty($feature.Accom_Accommod_1))
{
return 'Nothing Found'
}
else if (isEmpty($feature.Accom_URL))
{
return $feature.Accommod_1
}
else
{
return Concatenate([$feature.Accommod_1, $feature.Accom_URL], ' - ')
}