how to get a image url from API
# ask-stanley-ai
i
how to get a image url from API
c
AI generated answer (using internal Slack threads):
To get an image URL from the NetSuite API, you can use the
getText
method on an image field. This method will return the URL of the image. However, it's important to note that this method might not always be reliable. Here's an example of how you can use the
getText
method:
Copy code
javascript
var imageField = record.getText({fieldId: 'custitem_image_url'});
In this example,
custitem_image_url
is the ID of the image field. The
getText
method will return the URL of the image. Alternatively, you can use a formula in a saved search to display the image from a URL. Here's an example of how you can do this:
Copy code
html
'<div><img src="' + {custitem_image_url} + '" width="100px" /></div>'
In this example,
custitem_image_url
is the field that contains the URL of the image. The formula will create an HTML
img
tag with the URL of the image. Please note that you need to ensure that "Disable HTML in Search Formula (Text)" is not enabled in Setup > General preferences. ****** Disclaimer: This response was generated by an artificial intelligence assistant based on previous conversations from multiple Slack channels, and may contain inaccuracies or mistakes. ******
Slack thread 1: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.826187253
Slack thread 2: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.818263531
Slack thread 3: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.799386501
Please provide your feedback on this answer.