Javascript novice and am stuck trying to convert a staticresource record body to a parseable string, and hoping someone might know how to proceed?
I have retrieved the static resource successfully using jsforce library. The resource is a csv file, and the body attribute of the result returned presents as a url ie. Body : "/services/data/v56.0/sobjects/StaticResource/resourceId/Body"
I tried to prepend the domain and url together and do this, but nothing happened..no errors, no console output; maybe the wrong approach?
// res.records[0].Body definitely returns the url for the body
// I have put 'domain' in place of my actual salesforce domain :)
const url = 'https://domain.lightning.force.com' + res.records[0].Body;
fetch(url)
.then(res => {console.log(res); });
Beyond this point I'm stuck - I've not been able to figure out how to get any further. Any suggestions on how to get from this url to actually having a usable result would be really appreciated!