Hi all, does anyone know a formula to display the ...
# general
j
Hi all, does anyone know a formula to display the image from a url in a saved search?
m
Have you tried: formula (text) : ‘<img src=“image url”>’
j
would i replace "image url" with our field that contains the url?
example: ‘<img src={custitem_image_url}>’
m
Yup!
j
gotcha! unfortunately, im getting an ERROR: Invalid Expression
m
Try ‘<img src= “{custitem_image_url}”>’
a
Copy code
'<div><img src="link_to_photo.png" width="75px" /></div>'
used in conjunction with a case statement in a text formula field. per this blog https://www.callawaycoffee.com/case-when-statements-in-netsuite/
j
thank you! i was able to get this to appear:
but not the actual image
a
looks like your link is broken?
j
CASE WHEN {includechildren} = 'T' THEN '<div><img src="“{custitem_image_url}" width="100px" /></div>' ELSE '<div> </div>' END
the image link url works, but the output is not working for some reason
m
Do you have “Disable HTML in Seach Formula (Text)” enabled in Setup> General preferences? 🤔
j
nope, we do not!
m
Based on that formula, your image link will be the string
{custitem_image_url}
, not the value of the field with that ID.
a
Change your formula to this CASE WHEN {includechildren} = 'T' THEN '<div><img src="’|| {custitem_image_url} ||’" width="100px" /></div>' ELSE '<div> </div>' END Note there is a double quote then single quote after img src=