Index

Validating scripts when launching listings

Validate Listings

Calls validateListing() with a listing as a parameter for each listing in the LaunchControl window. You can return an array of strings containing custom warnings, or an empty array, each time your validateListing() method is called.

function validateListing(listing) {
    errors = [];
    imageIndex = 1;
    for (const image of listing.images) {
        if (!image.caption || image.caption.length == 0) {
            errors("Image " + imageIndex + " has no caption");
        }
		imageIndex = imageIndex + 1;
    }
    return errors;
}


<< Running Scripts eBay Listing JavaScript properties >>