if dynamic photo path does not exist, return else. how?

217
2
05-10-2022 03:23 PM
Labels (1)
Glasnoct
New Contributor III

I have dynamic paths set up for a set of photos I've added to my map series and if the arcade expression does not result in a valid image path, nothing shows up on that particular sheet, which is fine, but is there a way to evaluate whether the path exists or not and if not, return another path instead?  I'm inserting excel tables into the map and for the sheets which have no table, I want an image of an empty table to take its place without having to duplicate and rename the image for every "empty" sheet. Can I do this?

0 Kudos
2 Replies
JeffBarrette
Esri Regular Contributor

One possibility is to include Python with your solution.  Python has all sorts of file management functions.  For example:

if os.path.exists(os.path.join(someFolderPath, someFileName))

    do something

else:

    do something else

0 Kudos
Glasnoct
New Contributor III

The expression builder for the picture path is arcade-only, so python's not going to work. I will eventually get around to modifying the elements on my layout via arcpy but in the meantime I'm using the dynamic path of the picture object.

Does arcade not have a function I might be able to use as a makeshift exists(path) of sorts?

0 Kudos