I’m trying to apply Regex (str.matchAll) text matching to the output of the Read PDF node but it seems to see the output but can’t actually process it. I’ve read through a lot of posts here and they all seem to say that the node is extremely dated and possibly error prone. Any workarounds to this? I’m getting the PDF file via an API call so any external processing is not possible, unfortunately. Is this an error in my code or am I crazy? This has been haunting me for hours now!
What is the error message (if any)?
None, fails silently.
Please share the workflow
Input: PDF File with the string literal saved in Function Node.
The Function Node works perfectly fine if it’s processing the string literal internally or from a Set Node but not from the Read PDF node.
Hey @ugly, I am sorry to hear you’re having trouble here. Could you share the data returned by your Read PDF node so I can test this on my end against your actual data? Feel free to redact confidential parts, I am more interested in the structure than the actual content.
never mind … I already made a test.pdf myself and tested it. Very strange that your function seems to work fine when working with sample data, but does not work with the json from the Read PDF node, which looks exactly the same.
Wow. Tbh, I have no idea what is causing this, typeof items[0].json.text tells me the data coming from the Read PDF node is a valid string. I’ll see if I can revisit this when I have some more time on my hands, for now thanks so much for sharing a solution here @dickhoning!
This has indeed fixed it so that I can use the output of the Read PDF node but has broken my regex due to all the page breaks being converted to the literal “\n”
I think I’m going to have to put this project on pause because the Asana node has an issue now as well when I try to create a subtask for each item from the function node, the first item goes through and the rest have this cryptic error.
The second error is most likely due to an expression only working for the first item. Seems like asana is expecting a numeric value for your task field - which expression are you using for that field?
Definitely a numeric value, the gid of the parent task. Have tried it with the Asana node and the HTTP Node, (in JSON format) and both create the first item without problems and the second onwards all have the same 400 Error. The gid doesn’t change between tasks which is strange.
Hey @ugly, and this gid of the parent task would be fetched using an expression? Are you using $item(0) in your expression as described here?
If not, your expression would for the first item it processes try to read the first element from the node providing your gid value. Then for the second item if would try and read the second element from the node providing your gid value which I suspect might fail from the sounds of it.