Search for empty photo field?

Viewing 2 reply threads
  • Author
    Posts
  • January 3, 2021 at 1:02 PM #43042

    Wilma
    Participant

    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.

    January 3, 2021 at 11:55 PM #43044

    Brendan
    Keymaster

    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

    January 4, 2021 at 12:43 PM #43048

    Sam Moffatt
    Participant

    I also have a video walking through for creating a search for an empty photo field that might help as well.

Viewing 2 reply threads

You must be logged in to reply to this topic.