Question concerning Images

Viewing 2 reply threads
  • Author
    Posts
  • July 23, 2020 at 11:03 AM #41482

    Rocky Machado
    Participant

    Hi Team – Is it possible to load an image into a script field. I have a Trade Summary form and want to get the first image from my link form (Trade Journal form) and display it within my Trade Summary Layout form. Not sure if I am using the correct image properties, but here is a small sample of my code in the script field.

    let linkTradeJournal = record.getFieldValue('fld-310f922806294fcda6e0215c29b7b1ff');
    for (rec in linkTradeJournal){
    	
    	//-- Only need the first entry of the record set
    	let img = linkTradeJournal[rec].getFieldValue('fld-f2a5d1f9d7cc4ef9bc96e25f3aa3497b');
    	return img[0].mimtype;
    		
    }

    thanks,
    rocky

    July 23, 2020 at 9:48 PM #41490

    Brendan
    Keymaster

    Hi Rocky,

    Script fields cannot display images, but you can write a script to add an image to a Photo field. There’s an API for getting an image from a URL:

    record.addPhotoFromUrlToField(image_url, photo_field_id);

    July 24, 2020 at 6:25 AM #41494

    Rocky Machado
    Participant

    Hi Brendan – I thought so, but thought I would ask. Yesterday, I implemented what you have recommended.

    Thanks again,
    rocky

Viewing 2 reply threads

You must be logged in to reply to this topic.