PDF Template

I can’t get the templates to work.
I just want to display a value in the PDF.
I want to use the “Start” function.
Errors in picture 1.
Photo 2 my table from which I want to extract the data.
Photo 3 the parameters of my process.
Photo 4 my template

Can you tell me where I am wrong?

Thanks in advance.

Even simplifying, I still have a problem. Picture 1 : Template
Picture 2 : Errors
I can’t display a single value in my table. I think there is something I am missing. I guess it’s very silly, but I just can’t seem to figure it out.

Well, [Client] is not the Key field of your table by the looks of it?

Isn’t [ID heure] your key field?

A Start: expression has to return a list of Key Ref fields

Try

<<Start: [ID heure]>> <<[Client]>> <> <>

See what you get..

1 Like

I just noticed that I forgot to mention the fact that in my table “Gestion des heures” the first 4 columns are automatically taken from another table by the “Importrange” function.
I tried to take the Key column from my other table via the “importrange” function but nothing works…

Ok, here’s my advice. Go back to your original Task that creates the PDF and use the button to generate a new Template

Save and then view this template. Appsheet will fill in the created field names that it can ‘see’ based on the table the PDF is based on. This template as it is, SHOULD generate a PDF output without any errors…verify that this does work and then come back to us in the community with a screenshot of the output of the PDF and we will help you write your Start: command.

3 Likes

Hello,

As requested, I followed your advice.
Here is the pdf recreated by Appsheet.
Photo below: The new document, I did not touch anything.

Here is the associated error list (I put it in this format for more readability):

Run task "Task for Créer fichier gestion des heures"
Error 1 : Task 'Créer fichier gestion des heures' Body template. Expression '[Date]' is invalid due to: Unable to find column 'Date'.
Error 2 : Task 'Créer fichier gestion des heures' Body template. Expression '[Client]' is invalid due to: Unable to find column 'Client'.
Error 3 : Task 'Créer fichier gestion des heures' Body template. Expression '[N° de Commande]' is invalid due to: Unable to find column 'N° de Commande'.
Error 4 : Task 'Créer fichier gestion des heures' Body template. Expression '[Tache éffectuée]' is invalid due to: Unable to find column 'Tache éffectuée'.
Error 5 : Task 'Créer fichier gestion des heures' Body template. Expression '[Intervenant]' is invalid due to: Unable to find column 'Intervenant'.
Error 6 : Task 'Créer fichier gestion des heures' Body template. Expression '[Nb heure Jonathan]' is invalid due to: Unable to find column 'Nb heure Jonathan'.
Error 7 : Task 'Créer fichier gestion des heures' Body template. Expression '[Nb heure Adrien]' is invalid due to: Unable to find column 'Nb heure Adrien'.
Error 8 : Task 'Créer fichier gestion des heures' Body template. Expression '[Nb heure Didier]' is invalid due to: Unable to find column 'Nb heure Didier'.
Error 9 : Task 'Créer fichier gestion des heures' Body template. Expression '[Nb heure David]' is invalid due to: Unable to find column 'Nb heure David'.
Error 10 : Task 'Créer fichier gestion des heures' Body template. Expression '[Nb heure Mickael]' is invalid due to: Unable to find column 'Nb heure Mickael'.
Error 11 : Task 'Créer fichier gestion des heures' Body template. Expression '[Nom Intérimaire 1]' is invalid due to: Unable to find column 'Nom Intérimaire 1'.
Error 12 : Task 'Créer fichier gestion des heures' Body template. Expression '[Nb heure Intérimaire 1]' is invalid due to: Unable to find column 'Nb heure Intérimaire 1'.
Error 13 : Task 'Créer fichier gestion des heures' Body template. Expression '[Nom Intérimaire 2]' is invalid due to: Unable to find column 'Nom Intérimaire 2'.
Error 14 : Task 'Créer fichier gestion des heures' Body template. Expression '[Nb heure Intérimaire 2]' is invalid due to: Unable to find column 'Nb heure Intérimaire 2'.
Error 15 : Task 'Créer fichier gestion des heures' Body template. Expression '[Nom Intérimaire 3]' is invalid due to: Unable to find column 'Nom Intérimaire 3'.
Error 16 : Task 'Créer fichier gestion des heures' Body template. Expression '[Nb heure Intérimaire 3]' is invalid due to: Unable to find column 'Nb heure Intérimaire 3'.
Error 17 : Task 'Créer fichier gestion des heures' Body template. Expression '[Nom Intérimaire 4]' is invalid due to: Unable to find column 'Nom Intérimaire 4'.
Error 18 : Task 'Créer fichier gestion des heures' Body template. Expression '[Nb heure Intérimaire 4]' is invalid due to: Unable to find column 'Nb heure Intérimaire 4'.
Error 19 : The document body is empty

Hello,

As requested, I followed your advice.
Here is the pdf recreated by Appsheet.
Photo below: The new document, I did not touch anything.

Here is the associated error list (I put it in this format for more readability):

Run task "Task for Créer fichier gestion des heures"
Error 1 : Task 'Créer fichier gestion des heures' Body template. Expression '[Date]' is invalid due to: Unable to find column 'Date'.
Error 2 : Task 'Créer fichier gestion des heures' Body template. Expression '[Client]' is invalid due to: Unable to find column 'Client'.
Error 3 : Task 'Créer fichier gestion des heures' Body template. Expression '[N° de Commande]' is invalid due to: Unable to find column 'N° de Commande'.
Error 4 : Task 'Créer fichier gestion des heures' Body template. Expression '[Tache éffectuée]' is invalid due to: Unable to find column 'Tache éffectuée'.
Error 5 : Task 'Créer fichier gestion des heures' Body template. Expression '[Intervenant]' is invalid due to: Unable to find column 'Intervenant'.
Error 6 : Task 'Créer fichier gestion des heures' Body template. Expression '[Nb heure Jonathan]' is invalid due to: Unable to find column 'Nb heure Jonathan'.
Error 7 : Task 'Créer fichier gestion des heures' Body template. Expression '[Nb heure Adrien]' is invalid due to: Unable to find column 'Nb heure Adrien'.
Error 8 : Task 'Créer fichier gestion des heures' Body template. Expression '[Nb heure Didier]' is invalid due to: Unable to find column 'Nb heure Didier'.
Error 9 : Task 'Créer fichier gestion des heures' Body template. Expression '[Nb heure David]' is invalid due to: Unable to find column 'Nb heure David'.
Error 10 : Task 'Créer fichier gestion des heures' Body template. Expression '[Nb heure Mickael]' is invalid due to: Unable to find column 'Nb heure Mickael'.
Error 11 : Task 'Créer fichier gestion des heures' Body template. Expression '[Nom Intérimaire 1]' is invalid due to: Unable to find column 'Nom Intérimaire 1'.
Error 12 : Task 'Créer fichier gestion des heures' Body template. Expression '[Nb heure Intérimaire 1]' is invalid due to: Unable to find column 'Nb heure Intérimaire 1'.
Error 13 : Task 'Créer fichier gestion des heures' Body template. Expression '[Nom Intérimaire 2]' is invalid due to: Unable to find column 'Nom Intérimaire 2'.
Error 14 : Task 'Créer fichier gestion des heures' Body template. Expression '[Nb heure Intérimaire 2]' is invalid due to: Unable to find column 'Nb heure Intérimaire 2'.
Error 15 : Task 'Créer fichier gestion des heures' Body template. Expression '[Nom Intérimaire 3]' is invalid due to: Unable to find column 'Nom Intérimaire 3'.
Error 16 : Task 'Créer fichier gestion des heures' Body template. Expression '[Nb heure Intérimaire 3]' is invalid due to: Unable to find column 'Nb heure Intérimaire 3'.
Error 17 : Task 'Créer fichier gestion des heures' Body template. Expression '[Nom Intérimaire 4]' is invalid due to: Unable to find column 'Nom Intérimaire 4'.
Error 18 : Task 'Créer fichier gestion des heures' Body template. Expression '[Nb heure Intérimaire 4]' is invalid due to: Unable to find column 'Nb heure Intérimaire 4'.
Error 19 : The document body is empty

Here is the associated error list:

How very strange!

When was the last time you made changes to your table and did you Regenerate the Table structure after making the changes?

1 Like

Are all the parts of your bot using the same Table as their base?

Your Action is using that Table name for sure, but can you check and see if the Event and the Process are also using that Table name?

1 Like

Every time I make changes in my database I click on “Regenerate Structure”.

My bot’s event is scheduled every 24th of the current month.
Appsheet does not need a reference table for the scheduled events.
The idea is to send a detailed report, by email, of all the hours worked by my team for each job.

Shouldn’t you have the ForEachRowInTable option ticked and specify a table then?

Or at least to check the Process (You can do that from the bot…bottom left hand corner…it will say Process in blue).

1 Like

I tried to put it in “ForEachRowInTable”. When I do it, it writes me this error…

I also tried to go to “process” in blue.
I changed the table from “None” to “Time Management”. I get the same error…

Ok, so your bot process does not give your PDF template an initial starting table to work with. Because of this it is throwing an error for every one of your fields in that template as it is. We will have to construct a <Start:> <> expression around those fields.

Based on your table name, add the following before your first field.

<<Start: FILTER(“Gestion des heures”,TRUE)>>

and after your last field

<>

2 Likes

I restarted everything from the beginning.
I created a BOT from my other table.
Then I proceeded step by step to make the process work.
Now it finally works…
Sorry for the loss of time.

I noticed though that by setting it to ForEachRowInTable and including the right table, it finally works. Strangely enough I had tried before but nothing worked.
I think when I started again with a new BOT I must have fixed a configuration problem.

In any case, thank you very much for your time, it helped me a lot, thanks to you I understand better how the bot works.

Hey @Mickael_Guillor , it’s not a loss of time because it now works and you learned something about bots :blush: I still have lots to learn about them myself!

If you do set it to be ForEachRowInTable though you will get many emails being sent. I would advise to explore that <Start:> expression to get your bot to send 1 email with all of the summarised rows in a single PDF attachment.

Making the Process configuration have the same Table as the one you are working with in your PDF template has caught me out a few times. Especially when the documentation says you can re-use processes in other bots…I think that needs further explanation in the docs though.

Glad I could help!

1 Like