What we are trying to do is utilize Gemini to do a one click process of entering product information into Wix. Click and it takes a pic which is used to search for a description of the product, load it into the Wix data entry page, and pause for us to verify. We can get the product description and proposed price (we are a reuse store), but it won’t load the picture (which is stored at Cloudinary) and it won’t check the category box. It’s still faster than it was but not where we want it. The following questions wre generated by “Maestro” (I change the name to Bob) in the Symphony AI app.
1. Category/Collection assignmentcollections.addProductsToCollection(collectionId, [productId]) always throws: TypeError: Cannot read properties of undefined (reading 'length')
The collection IS found correctly (confirmed by querying with queryCollections). I’ve tried:
addProductsToCollection(collectionId, [productId])addProductsToCollection(collectionId, { productIds: [productId] })addProductsToCollection({ collectionId, productIds: [productId] })- Passing
collections: [{ _id: collectionId }]directly intocreateProduct wixData.insert('Stores/CollectionProducts', ...)
None work.
2. Image from external URL Passing media: { mainMedia: { image: { url: externalUrl } } } either in createProduct or updateProduct returns Bad Request.
The external URL is a valid public Cloudinary HTTPS URL that loads fine in a browser.
What is the correct way to do both of these in a backend .jsw file using wix-stores.v2?