Hi all, is it at all possible to specify a search for empty photo fields? My “cover photo” field (type = photo) does not show up in the options under Search Rules. Thank you.
Hi Wilma,
You can do this, but not directly. You just need to add a Script field to your form and add in the following code to the script editor:
function photoCount() {
var case_cover = record.getFieldValue('fld-your-field-id-goes-here');
return case_cover.length;
}
photoCount();
This will give you the number of photos in the Photo field. You can then create a Saved Search which looks at this and checks to see if the value is greater than 0.
You’ll need to replace the fld-your-field-id-goes-here
part with the Field ID for your own Photo field. You can get that from below the Fields list when viewing the list of fields in your form.
Thanks!
Brendan
I also have a video walking through for creating a search for an empty photo field that might help as well.