Is it possible to check a PDF integrity before sending it via mail?

Hello friends, i’m currently developing an app that generates documents based on a google docs template, and i’m trying out the new automation gadgets.

I’m testing if I can obtain a reliable performance from a bot that generates a PDF based on a condition, waits the minimum duration available (5 mins + up to 5 mins of maximum potential delay) and then sends it via email.

The wait is intended to give time to AppSheet to generate the document.

My problem is that sometimes the PDF’s just don’t work, I get an error screen like “the document cannot be opened” which is solved easily by generating the document again, sadly, this is no longer an easy fix for me, since I want the bot to send an email with THAT document automatically.

How could I make sure that the PDF that reaches the last task of my bot is a healthy one?

PD: I’m quite certain this isn’t a cache issue

Solved Solved
1 4 116
1 ACCEPTED SOLUTION

I am trying to make sure I understand your question. You have a google doc as a template for a bot that sends the attachment. The current problem is that it will not send.

I have never used a delay before to give AppSheet time to generate the document I must say I am not sure that a delay is necessary.

Also there could be either a problem with an expression in your template or it could not be efficient enough causing the generation of the document to time out. An easy way to make a pdf template more efficient is to create a virtual column in AppSheet that generates a value that you commonly use in your template and then have the template just pull that value, instead of calculate it.

Below I linked a resource incase you need help creating templates it is free on youtube. If there are still problems any pictures you could add would be very helpful and I can try my best to help you with them.

Craig
QREW Technologies

Template generation

View solution in original post

4 REPLIES 4

I am trying to make sure I understand your question. You have a google doc as a template for a bot that sends the attachment. The current problem is that it will not send.

I have never used a delay before to give AppSheet time to generate the document I must say I am not sure that a delay is necessary.

Also there could be either a problem with an expression in your template or it could not be efficient enough causing the generation of the document to time out. An easy way to make a pdf template more efficient is to create a virtual column in AppSheet that generates a value that you commonly use in your template and then have the template just pull that value, instead of calculate it.

Below I linked a resource incase you need help creating templates it is free on youtube. If there are still problems any pictures you could add would be very helpful and I can try my best to help you with them.

Craig
QREW Technologies

Template generation

Hi @Rafael_ANEIC-PY, I’m gonna answer in spanish if that’s not a problem for you

Lo que suelo hacer es crear el escenario de que el bot solamente pueda crear el documento y tener acceso al documento desde la app.
Luego tengo una acción que abre un formulario en el cual puedo seleccionar los documentos que necesito enviar y agregar otra info, como el asunto del correo, cuerpo del correo, mails, etc.
Existe un segundo bot que se encarga de enviar un mail cada vez que se agrega un registro a la tabla mencionada anteriormente y ya te imaginas cómo se prepara ese mail, tomando los valores de las columnas que tiene dicha tabla y los adjuntos van en Other attachments.
Si te parece una buena idea y se acomoda a tu necesidad (generar el pdf, ver si está bien, luego enviarlo) te puedo explicar en un poco más de detalle el esquema de las tablas

It is the first idea that came to me.
Maybe firstly store it in a FileType column and add a button to send it after checking?

Actually it won’t work as you wish but will let you check the doc before sending.

Just thinking…

Hmm, I might be over complicating the problem, this bot I mentioned is made from standalone actions and tasks, from generating the file to sending it, maybe I should just get it done in a single task

El tema es que estoy tratando de que todo el proceso de crear el pdf y enviarlo se haga a partir de una sola acción, el tiempo que tarde no es tanto problema, pero creo que mi paranoia con la generación de los pdfs me llevo a introducir un problema al tratar de enviar documentos generados anteriormente, cuando podria generar el documento Y enviarlo con un solo email task.

Indeed, but I dont want to look at it hehe, that was the old way, and it introduced a few human errors along the road, but that’s another subject.


I think I got it, instead of separating the creation of the PDF and its email distribution I should just use the task that generates the PDF in the first place to send it straight away, thanks guys !

Top Labels in this Space