I'm trying to run through a loop of uploaded images and send each one to cloudinary. Cloudinary doesn't support uploading images in bulk, so we're using the loop to do them one by one.
The query itself works great for a single image, but I can not figure out how to pass the data correctly in the loop. It should use the base64 values of the selected images in a file dropzone component. They should get sent to cloudinary in the body of the API request as the "file" key.
To my understanding, this can be passed via additionalScope, but that hasn't been working for me.
I tried adding the file key into the API call query with a blank value, but when I run the call through the loop it tried to send "file" and the blank value rather than using the additionalScope.
Have you tried adding {{ file }} instead of leaving it blank? When the JS triggers the query and sends the additional scope, you can refer to it as you would with any other variable in the system. What you are seeing in the result as additional scope is just informing you about the additional scope that was available, but it is actually not used until you indicate where to use it.
Triggering a query with additionalScope simply exposes a key-value pair that you can then reference within the query itself. In this case, that means referencing {{ file }}. You will likely need to add a key of file to the body of your query that is set equal to {{ file }}.
I recommend checking out @victoria's post here on utilizing additionalScope if you haven't seen it before! Let us know if you run into any other issues or have additional questions.