Check on empty blob field

Viewing 4 reply threads
  • Author
    Posts
  • April 20, 2021 at 8:01 AM #44219

    Dirk Soenen
    Participant

    Is it possible to check whether an image field contains an image or is empty ?

    April 20, 2021 at 9:54 AM #44220

    Daniel Leu
    Participant

    Yes, you can check this in a script:

    function Has_Photo() {
    	var photo_id = 'fld-xxx';
    	var photo = record.getFieldValue(photo_id);
    	
    	if (photo.length == 0){
    		return "has no photos";
    	} else {
    		return "has " + photo.length + " photos";
    	}
    
    }
    
    Has_Photo();
    April 20, 2021 at 11:08 PM #44227

    Dirk Soenen
    Participant

    Hi Daniel,

    Thanks for your response. I’ve never used scripts, this is definitely the moment to explore. I’m starting with the tap forms javascript scripting 101 manual today. Never too old to learn.

    April 21, 2021 at 7:49 AM #44232

    Daniel Leu
    Participant

    Hi Dirk, welcome to scripting! Without scripting, I wouldn’t be a TapForms user!

    April 21, 2021 at 10:12 PM #44233

    Brendan
    Keymaster

    I’m glad I added scripting then Daniel! :)

    April 21, 2021 at 11:23 PM #44234

    Daniel Leu
    Participant

    I’m glad I added scripting then Daniel! :)

    :)

Viewing 4 reply threads

You must be logged in to reply to this topic.