I am using Retool PDF component that display data, and it's working perfectly. However, I believe there is an issue with retrieving data from your API.
I'm fairly sure that the Salesforce API is streaming the PDF data back to you in a fashion similar to what is described here, meaning you have just one part of the file. The solution likely involves awaiting the result of your query in order to ensure that you have the entire document prior to converting it!
Hi Darren - Appreciate the response! Any ideas on how to do that? I've tried a few different things online using a transformer or JS query without luck
That'd be amazing! I actually have both working - the built-in Salesforce connector using the CRUD Action type to retrieve content version details, and the REST API connection using the endpoint services/data/v61.0/sobjects/ContentVersion/XXX/VersionData
Both are returning the same response. Let me know if there's anything else I can provide. Thanks!
It has actually been surprisingly difficult to get this working! After digging into it more, I don't think the issue is asynchronicity - the Salesforce API is just returning a raw text representation of the PDF file. The following is the closest I got to processing the response and getting it to display within Retool:
The result is a correctly-formatted PDF, but it's missing content. I haven't pursued this as the authorization would be kind of a pain, but my most recent idea is to write a fetch request as a raw JS query in order to handle the result as an arraybuffer.