Zarcco
Zarcco6mo ago

email trigger

Hi nocoders, currently I'm having an issue with the email trigger; I've been trying to get the attachment but with no success. I already get the json using: ${(x)body.fields[attachment-info]} Do you have any idea how to access to: attachment1 > filename ? Thankyou in advance!
No description
No description
Solution:
Hi @Zarcco, extract the data received from the response of the which you require to an empty script node and then edit the node with the AI to with prompt extract the require data from this json, give the above json as example in the prompt as well. For using with the dot notation, you'll be require to add email variable instead from body, as the body you are referencing it from the request not from the Email Trigger request body. Use this expression. Please note you might encounter while adding this expression in editor, we'll are tracking and will add a fix soon....
No description
Jump to solution
16 Replies
Zarcco
ZarccoOP6mo ago
I tryed this code too but no lucky...
No description
Henry Moses
Henry Moses6mo ago
can you try body.fields.attachment1.filename
Zarcco
ZarccoOP6mo ago
Hi Henry, thanks for answer my thread, I tried with that code but doesn't work. Here's the console log:
No description
Henry Moses
Henry Moses6mo ago
Ok give me one sec!
Zarcco
ZarccoOP6mo ago
Also I'm trying to route by editing the email trigger node but in the console doesn't show any data.
No description
No description
Zarcco
ZarccoOP6mo ago
here is the full log:
No description
Henry Moses
Henry Moses6mo ago
Are you able to hop in this channel, so I can help? https://discord.gg/7FJyEKqJ
Zarcco
ZarccoOP6mo ago
yes no problem... in advance, my spoken english is bad haha!
Henry Moses
Henry Moses6mo ago
Hey @Gaurav Chadha just making sure I give the team viability on this. Is it possible for us to pull in an actual URL or base64 file from the email trigger node. @Zarcco is working to pull in the PDF and pass it to an openAI node. @Zarcco Keep me updated on what the client says and we can drive this to the finish.
Zarcco
ZarccoOP6mo ago
Sure Henry, thanks for all your support!
Henry Moses
Henry Moses6mo ago
Anytime
Zarcco
ZarccoOP6mo ago
Hi, I think I found the issue... the bracket is wrapped by colons " " because when I try to access to attachment1 using -> attachment-info[0].attachment1 the console print just -> 0: "{"
No description
Zarcco
ZarccoOP6mo ago
No description
Henry Moses
Henry Moses6mo ago
Did it work?
Zarcco
ZarccoOP6mo ago
Hello Henry, thank you for asking but I cannot find a proper solution to remove those extra characters.
Solution
Gaurav Chadha
Gaurav Chadha6mo ago
Hi @Zarcco, extract the data received from the response of the which you require to an empty script node and then edit the node with the AI to with prompt extract the require data from this json, give the above json as example in the prompt as well. For using with the dot notation, you'll be require to add email variable instead from body, as the body you are referencing it from the request not from the Email Trigger request body. Use this expression. Please note you might encounter while adding this expression in editor, we'll are tracking and will add a fix soon.
No description