I am currently encountering challenges with the Domo API while attempting to utilize the MERGE method in an AJAX request for dataset updates. Despite several attempts, the functionality does not seem to be working as expected. mergeKeys = ["Client Name", "Amazon Mkt", "ASIN"];
` if(fileValidtion){ showLoader();
var formData = new FormData();
formData.append('file', file);
var settings = {
async: true,
crossDomain: true,
url: `https://${url}domo.com/data/v2/dataset0?updateMethod=MERGE`,
method: 'POST',
processData: false,
data: formData,
contentType: false
};
$.ajax(settings)
.done(function (response) {
console.log('Dataset updated successfully:', response);
showSuccessModal('File Uploaded Successfully');
// Clear the file input
document.getElementById('formFile').value="";
alert('Dataset updated successfully!');
console.log('Dataset updated successfully!')
displayData();
})
.fail(function (xhr, status, error) {
console.error('Error updating dataset:', error);
console.log('XHR Response:', xhr.responseText);
// Show a popup indicating failed dataset update
alert('Error updating dataset. Please check the console for details.');
console.log('Error updating dataset. Please check the console for details.')
}) .always(function () {
// Hide the loader when the AJAX call is done (whether successful or failed)
hideLoader();
fileValidtion = false;
});`
Desired Outcome: I am seeking guidance on correctly implementing the MERGE method with specified merge keys for dataset updates using the Domo API. Here is the documentation for reference: Domo API Merge Method
This should help those who want to assist you by providing them with the necessary context and a direct link to the documentation.