Email Notification with Table of objects

If you have questions or if you want to share your opinion about Aware IM post your message on this forum
kklosson
Posts: 1617
Joined: Sun Nov 23, 2008 3:19 pm
Location: Virginia

Email Notification with Table of objects

Post by kklosson »

I am trying to configure a notification message that includes a table of objects. It does not appear that the LIST_TABLE function can be used in the notification message initialization. So I created an HTML document with that function included and I declared that document in the HTML Message attribute of the notification. The notification is launched from a list of Investigators, so Investigator is in context.

The HTML document looks like this:

Hello <<Investigator.FirstName>>,

You currently have the following review assignments in POBITS:

Candidate, Purpose, Notes to Reviewer
<<LIST_TABLE('FIND Review WHERE Review.Reviewer=Investigator','CandidateName', 'Purpose', 'NotesToReviewer')>>


The message outputs like this:

Hello <>, You currently have the following review assignments in POBITS: Candidate, Purpose, Notes to Reviewer <>


I can fix the HTML issues but the problem is that nothing populates.
V8.8
MySQL, AWS EC2, S3
PDFtk Toolkit
Jaymer
Posts: 2430
Joined: Tue Jan 13, 2015 10:58 am
Location: Tampa, FL
Contact:

Re: Email Notification with Table of objects

Post by Jaymer »

The Doc has to use < and >
Click Here to see a collection of my tips & hacks on this forum. Or search for "JaymerTip" in the search bar at the top.

Jaymer
Aware Programming & Consulting - Tampa FL
kklosson
Posts: 1617
Joined: Sun Nov 23, 2008 3:19 pm
Location: Virginia

Re: Email Notification with Table of objects

Post by kklosson »

Thank you, but can you explain that, please?
V8.8
MySQL, AWS EC2, S3
PDFtk Toolkit
Jaymer
Posts: 2430
Joined: Tue Jan 13, 2015 10:58 am
Location: Tampa, FL
Contact:

Re: Email Notification with Table of objects

Post by Jaymer »

In the html file, the one that is on the file system, the file get the gets imported as the template,
You cannot use the greater than and less than merge symbols like you do inside aware.
You must use the Html designation
Click Here to see a collection of my tips & hacks on this forum. Or search for "JaymerTip" in the search bar at the top.

Jaymer
Aware Programming & Consulting - Tampa FL
kklosson
Posts: 1617
Joined: Sun Nov 23, 2008 3:19 pm
Location: Virginia

Re: Email Notification with Table of objects

Post by kklosson »

Thanks again.

My html doc looks like this:

Hello &lt&ltInvestigator.FirstName&gt&gt,<br><br>

You currently have the following review assignments in POBITS:<br><br>

&lt&ltLIST_TABLE('FIND Review WHERE Review.Reviewer=Investigator','CandidateName', 'Purpose', 'NotesToReviewer')&gt&gt


My email message looks like this:

Hello &lt&ltInvestigator.FirstName&gt&gt,

You currently have the following review assignments in POBITS:

&lt&ltLIST_TABLE('FIND Review WHERE Review.Reviewer=Investigator','CandidateName', 'Purpose', 'NotesToReviewer')&gt&gt
V8.8
MySQL, AWS EC2, S3
PDFtk Toolkit
Jaymer
Posts: 2430
Joined: Tue Jan 13, 2015 10:58 am
Location: Tampa, FL
Contact:

Re: Email Notification with Table of objects

Post by Jaymer »

Code: Select all

Hello <<Investigator.FirstName>>,<br><br>
Click Here to see a collection of my tips & hacks on this forum. Or search for "JaymerTip" in the search bar at the top.

Jaymer
Aware Programming & Consulting - Tampa FL
tford
Posts: 4238
Joined: Sat Mar 10, 2007 6:44 pm

Re: Email Notification with Table of objects

Post by tford »

Kingsley,

Try simply placing your code in the Message attribute of the notification.
Hello <<Investigator.FirstName>>,

You currently have the following review assignments in POBITS:

Candidate, Purpose, Notes to Reviewer
<<LIST_TABLE('FIND Review WHERE Review.Reviewer=Investigator','CandidateName', 'Purpose', 'NotesToReviewer')>>
As a test to confirm since I haven't done this in V8.4, I put this in the Initial Value of the Message field of my SystemSettings BO & sent it. Result was table list of BDLs:
Dear <<SystemSettings.EmailAddress>>,

Here is the list you requested:
<<LIST_TABLE (SystemSettings.BDLs, `Name`, `EmailAddress`)>>
----
Tom - V8.8 build 3137 - MySql / PostGres
tford
Posts: 4238
Joined: Sat Mar 10, 2007 6:44 pm

Re: Email Notification with Table of objects

Post by tford »

Note that the ` I used around the attributes are the character below the tilde on the keyboard.
Tom - V8.8 build 3137 - MySql / PostGres
kklosson
Posts: 1617
Joined: Sun Nov 23, 2008 3:19 pm
Location: Virginia

Re: Email Notification with Table of objects

Post by kklosson »

Thanks, Tom.

I've tied putting in the message and in an HTML document. The <<Investigator.FirtName>> prints out fine either way. No matter how I do the LIST_TABLE, no good. It either prints the whole command string (when in the HTML document) or nothing at all (when in the message block).

Does anyone see anything wrong with my LIST_TABLE construct?
V8.8
MySQL, AWS EC2, S3
PDFtk Toolkit
kklosson
Posts: 1617
Joined: Sun Nov 23, 2008 3:19 pm
Location: Virginia

Re: Email Notification with Table of objects

Post by kklosson »

Good call on the apostrophes; I always forget that. But still no joy. Here's the exact text in the HTML document:

Hello <<Investigator.FirstName>>,<br><br>

You currently have the following review assignments in POBITS:<br><br>

<<LIST_TABLE(`FIND ALL Review`,`CandidateName`,`Purpose`,`NotesToReviewer`)>>

Here's what I get:

Hello James,

You currently have the following review assignments in POBITS:

The LIST_TABLE function is simply ignored.
V8.8
MySQL, AWS EC2, S3
PDFtk Toolkit
kklosson
Posts: 1617
Joined: Sun Nov 23, 2008 3:19 pm
Location: Virginia

Re: Email Notification with Table of objects

Post by kklosson »

I have also tried changing the query string in the function to call a query i.e.,

<<LIST_TABLE(`InvestigatorOpenReviews`,`CandidateName`,`Purpose`,`NotesToReviewer`)>>

What is the significance that the query in the documentation example is not quoted?
<<LIST_TABLE(Client.Children, ‘FirstName’, ‘LastName’, ‘Age,#’)>>

I also do not know what Client.Children might represent in database terms.
V8.8
MySQL, AWS EC2, S3
PDFtk Toolkit
tford
Posts: 4238
Joined: Sat Mar 10, 2007 6:44 pm

Re: Email Notification with Table of objects

Post by tford »

Client.Children ...

Client is a BO with a reference attribute named Children. Children would be a Multiple Allowed reference.
Tom - V8.8 build 3137 - MySql / PostGres
kklosson
Posts: 1617
Joined: Sun Nov 23, 2008 3:19 pm
Location: Virginia

Re: Email Notification with Table of objects

Post by kklosson »

Tried that i.e., Investigator.Review, no joy.
V8.8
MySQL, AWS EC2, S3
PDFtk Toolkit
tford
Posts: 4238
Joined: Sat Mar 10, 2007 6:44 pm

Re: Email Notification with Table of objects

Post by tford »

You can put a query name in the first parameter like this:

<<LIST_TABLE (`A_BDL_Query`,`Name`,`EmailAddress`)>>

That's the syntax I suggest because you can run the query independently to ensure it delivers the intended results before trying to put those results in an email.
Last edited by tford on Sun Aug 16, 2020 4:29 pm, edited 1 time in total.
Tom - V8.8 build 3137 - MySql / PostGres
hpl123
Posts: 2579
Joined: Fri Feb 01, 2013 1:13 pm
Location: Scandinavia

Re: Email Notification with Table of objects

Post by hpl123 »

What Tom said :).

Weird things happens with the LIST functions when trying to build the query/parameters in the tag so try that.
Henrik (V8 Developer Ed. - Windows)
Post Reply