This post was split by a moderator from the topic:
I’m trying a similar flow and having trouble with the variable content dropping in a test run, but not while step-by-step tests during the automation build.
I’ve attempted to passing both the “body” variable from pdf.co as well as the “url” variable as was done in this example. In both cases, when I troubleshoot the steps, pdf.co extracts the content correctly, but fails to pass the variable (see screenshot).
I’ve added a 2 minute delay in case it was a race condition, per another thread, but that hasn’t helped.
I also tried the native chatgpt app, but that loses the variable in the same way.
I’ve also made sure I have more than enough credits in both pdf.co and chatgpt. When I check the pdf.co api logs on api.co’s website, I see a number of 0 credit interactions, but with a 200 success indicator.
I’ve been working on this a few days now and am out of ideas. Would super appreciate your collective guidance.
(update) When I investigate the step before (pdf.co) I see success in the logs until the last step… which is POSTing “no content”.
Page 1 / 1
@NewHerePleaseHelp @Ashl3y instead of PDF to Anything, what if you tried the PDF to Text action in PDF.co, and then passed the raw text output to AI by Zapier? I’m pretty sure that AI by Zapier can’t accept either URLs or hydrated file objects at the moment, only text and, more recently, images.
@NewHerePleaseHelp @Ashl3y another, more complicated option that consumes more tasks but avoids incurring PDF.co API usage:
A Google Drive Copy File step that creates a duplicate copy of the file and sets Convert to Document? to TRUE (this will make it readable text for the next step
A Retrieve File or Folder by ID step that retrieves the new copy just created
A Files by Zapier → Text from File step that takes in the File Markdown (Exists but not shown) variable from the previous step
Pass the text extracted from the previous step to AI by Zapier:
At the end, I also add a last Google Drive step to delete the copy of the Google Drive created at the beginning.
A full screenshot of my Zap is below. This is a lot of tasks, so I wouldn’t recommend this approach for a high-frequency trigger.
@DennisWF - Wow. Thank you for the fast response. Regarding your first recommendation, I have PDF to Anything configured to convert to text.
I don’t see a .pdf to text action in the setup. Am I missing something?
Will dig into your second recommendation (thank you!) this afternoon.
Thank you!
@Ashl3y my bad, I’ve been using PDF.co mostly via the API rather than through Zapier recently. I think your setup looks right. When that action runs, does it return the raw text output from the PDF as a variable you can pass to AI by Zapier? It won’t understand a file objects or a URL to a file, so you need to be able to give it the text directly.
@DennisWF - Yes. When I step through the testing, it produces both a “body” variable that has the full plain text record (less than two pages), as well as the URL variable. When I pass the body variable to Zapier AI (same when passing direct to chatGPT) this works in step testing, but when I test the whole run, I get an “!” in front of the variable by time it arrives at Zapier AI , which I presume indicates that there is no information contained in it.
Thank you!
@Ashl3y yeah, that seems like the PDFs in the live runs aren’t returning any body text when they go through the PDF to Anything step. Are they the same files you’re trying in test runs?
@DennisWF - A minor step forward and perhaps a clue!
As I’ve been experimenting, I added BOTH a ChatGPT and a Zapier AI step using the same ‘BODY’ variable from pdf.co.
The ZapierAI failed for the usual reasons, but chatGPT picked it up fine. I think that probably the best way forward is to proceed with the tool that works, even though I like how Zapier AI parses the output much better.
I also revisited drive permissions to make sure that the folders/documents had public links.
Any further thoughts on the matter?
@Ashl3y I’m still not sure why PDF.co isn’t properly returning the body in live runs, but if you already have the OpenAI API key and are ok with running up some usage, then passing the file object directly to a ChatGPT action is a more direct way of pulling this off.
Does anyone know why a text variable output from pdf.co would be accessible to chatgpt ‘conversation’ action, but not Zapier AI passing to chaptgpt? What am I missing?
@Ashl3y a text variable output is accessible to both ChatGPT and AI by Zapier, but a file object - which looks like File (exists but not shown) is only readable by the former. That’s because the AI by Zapier app doesn’t have the ability to read file objects. I would assume that functionality is probably on their roadmap, but they haven’t announced anything yet as far as I know.
Dennis,
I’ve decided to go directly to ChatGPT and incur the API fee, which I’m happy to do, because that is working. I have one (I hope) last problem… which is that, based on the parsed data, I have paths that are not working. I extract a number (years worked) from an output. Then use JavaScript (a code action) to convert it from a string to a variable ( from “9” to 9). When I try to create a route based on that, it fails. I could write the logic out in JavaScript, but I’m trying to keep as much of this in the Zap interface as possible so it’s easier to edit/tweak. The only reason I’m using the code function is that I couldn’t get the formatter to work.
As you’ll see from the screens, the number is, in fact, an integer (and not a string that has a number in it). Yet, the path is still failing? Have you seen this?
Bests,
A
@DennisWF - just to be as thorough as possible, I added a second output to the js code which sends the string “accept” or “deny”. You can see that in the test output, but all of my paths are still failing.
I really can’t fathom the problem here and, unfortunatley, am about to move on to a different platform/solution as this is taking me far too long. Thank you again for all of your support along the way.
Bests,
A
Hey @Ashl3y, this one is really strange. Just so I understand correctly, your JavaScript code is now evaluating the integer and directly returning an accept or deny string variable depending on whether it’s greater or less than 3, correct? The way you’ve set up your Path filter should work fine as far as I can tell if that’s the case.
This shouldn’t matter, but have you tried running the path filter on just the string variable and removing the OR condition?