Help with an expression on how to reference a max row in a pdf making bot

Hello,

I was hoping someone can assist.  Currently I have a bot generate a pdf and email it weekly.  I'm been trying to capture tech notes in the weekly report.  What I'm currently doing seems a bit cumbersome.  Hoping someone can assist in helping me clean this up.

I have a table Notes with a key column [Note #]  (which is generated by a max + 1 expression)

I am using these entries in my pdf template:

 

<<Select(Notes[Date Time],([Note #] = โ€œ1โ€),TRUE)>>

<<Select(Notes[Notes],([Note #] = โ€œ1โ€),TRUE)>>



<<Select(Notes[Date Time],([Note #] = โ€œ2โ€),TRUE)>>

<<Select(Notes[Notes],([Note #] = โ€œ2โ€),TRUE)>>



<<Select(Notes[Date Time],([Note #] = โ€œ3โ€),TRUE)>>

<<Select(Notes[Notes],([Note #] = โ€œ3โ€),TRUE)>>



<<Select(Notes[Date Time],([Note #] = โ€œ4โ€),TRUE)>>

<<Select(Notes[Notes],([Note #] = โ€œ4โ€),TRUE)>>

 

and so on, capped at 20 entries until I add more.

 

I was hoping someone could help me add an expression like MIN and MIN + 1, MIN + 2... So I can have the most recent note at the top.  Alternatively, I have a column [Date Time] which is a DateTime type that maybe I could also use as a Sort type.  Lastly, is there any way to write just 1 or 2 lines, and have the formula repeat on it's own?  I am trying to avoid listing out this 20 times, as well as, most importantly, not forget to add more lines when I reach 20 notes!

 

Thanks in advance!

Joe

0 3 233
3 REPLIES 3

In general, please try a template expression of

<<START: ORDERBY(Notes[Note #], [Date Time], TRUE)>>

<<[Date Time]>>

<<[Note #]>>

<<END>>

The above expression will list any number of records in descending order by date time.

As a side note, please note that having a serial number system as key is not a recommended practice in AppSheet unless the app is used in a very restrictive environment such as a single user app.

What is a key? - AppSheet Help

 

 

Worked perfectly, thank you so much for taking the time to help!!



Best Regards,

Joe Seiler
Fusion Alarms, LLC

You are welcome.

Top Labels in this Space