Trying to do this in Retool JS Script

var data = new FormData();
data.append('id', dncListId);
data.append('file', filebutton1.parsedvalue['0']);
data.append('fileType', 'dnclist');
data.append('phoneColumns', 'PhoneColumnName');
data.append('emailColumns', 'EmailColumnName');

then i am going to trigger my api and need to send the data through additional scope. I have the additional scope working, but i can't seem to get the data in right format to adde the additional columns above like filetype and columns. thoughts?

Hey there @claycurtis44,

It seems you're accessing your file button incorrectly, try removing the quotes, i.e. data.append('file', filebutton1.parsedvalue[0])

thanks, this is latest code, i don't get any value in my formData
var data = new FormData();

// Append values
data.append('fileType', 'dnclist');
data.append('id', 'cf76bc69-d2c2-45a5-8aba-3c8326457e46');
data.append('phoneColumns', 'PhoneNumbers');
data.append('file', fileButton1.parsedValue[0])

// Trigger API request and set the body as FormData
query8.trigger({
body: data // Send FormData directly in the body
});

Hi @claycurtis44,

Can you share more details about your broader use case for this script?

Have you tried hardcoding this data in the body of the API query and running it directly to confirm it works?

We're also happy to take a look in office hours, if you prefer!