Add option to limit Image field to one image
Due to the large size of images, it would be nice to be able to restrict the user of the app to only be able to add one image per image field and be able to overwrite that with a new image, instead of adding more images to a single field.
3
votes

-
Ashwar Sadh commented
Add a trigger script for before Saving the entry and check
if(entry(). field ("Image").length>1)
{
message ("Select only one image");
cancel ();
}Or you can make this script to overwrite 2nd image with 1st one and discard 1st one like this:
if(entry(). field ("Image").length>1)
{
entry().set("Image",[entry(). field ("Image")[1]]);
}