Sending email template

Hi,

Please help with this. I tried to create an email template, upon adding it, it will automatically send an email to the recipient. My problem is the second table(reference table) on my template did not show on the email content that the recipient has been received. Please suggest what would be the correct formula/expression for this.

0 34 426
34 REPLIES 34

3X_d_c_dc33d8c6f9d86b952a36233b385f114c2289437d.png

I m not sure your table schema, but this expression is causing an issue.

This expression should be returning NULL value for the moment, even your expression is โ€œvalidโ€

Yes, it returns a null value for now.

P3 Demand - Child table that links to Demand table thatโ€™s why column name is โ€œRelated P3 Demandsโ€

I want to get the value of the child table (Related P3 Demands) and reflect it on the email content.

Could you please suggest the correct expression?

Could you share the screenshot for that table, where we see the column configs.

Please see attached image.

Sorry , what i mean was P3 demands table.

On your original expression, what do you want to do with 5 at the end?
Top 5 or so?

For Controlling Record Order . to display 5 items only.

how do you define โ€œ5 onlyโ€?
Just display 5 rows max?

i m puzzled as well, โ€œRecord Orderโ€

yes, to display 5 rows max

For example I have 10 rows on my P3 Demands table, only 5 rows will reflect on the email.

The most latestly added 5 rows or something like that?

yes, the most latest added 5 rows if it is possible

On your screenshot, there is no column to hold date or datetime values, so you can rely on only row_number field.

how about this expression:
<<Start:TOP(ORDERBY([Related P3 Demands],[_RowNumber],TRUE),5)>>

is it correct?

Try it out now with it.

If it does not work then try this.

<<Start:TOP(ORDERBY(Select([Related P3 demands][P3 Demand ID],TRUE)),[_RowNumber]),5)>>

Itโ€™s not working

After I posted, i amended my typo, so

<<Start:TOP(ORDERBY(Select([Related P3 demands][P3 Demand ID],TRUE)),[_RowNumber]),5)>>

is what you tried?

You need to define how you decide how to judge 5 rows based on your conditions.
Based on some dates, or max values etc. Your are missing that definition to get the rows out.

yes, i tried that expression and i got an error.

Failed: Action not performed because 2 errors are present. Error: Workflow rule โ€˜Send Email to Initiator for New Demandโ€™ action โ€˜Send Email Notification to Initiatorโ€™ Body template. Expression โ€˜TOP(ORDERBY(Select([Related P3 demands][P3 Demand ID],TRUE)),[_RowNumber]),5)โ€™ is invalid due to: Expression โ€˜TOP(ORDERBY(Select([Related P3 demands][P3 Demand ID],TRUE)),[_RowNumber]),5)โ€™ could not be parsed due to exception: Number of opened and closed parentheses does not matchโ€ฆ Error: Workflow rule โ€˜Send Email to Initiator for New Demandโ€™ action โ€˜Send Email Notification to Initiatorโ€™ Body template. Start expression โ€˜TOP(ORDERBY(Select([Related P3 demands][P3 Demand ID],TRUE)),[_RowNumber]),5)โ€™ should generate a List of Ref values. Please verify that it generates a List and that the contents of the List are Ref values. Ref values should come from the โ€˜Keyโ€™ column of the referenced tableโ€ฆ

tried this formula:
<<Start:TOP(ORDERBY(Select([Related P3 demands][P3 Demand ID]),TRUE),[_RowNumber],5)>>

and I got an error again:
Failed: Action not performed because 2 errors are present. Error: Workflow rule โ€˜Send Email to Initiator for New Demandโ€™ action โ€˜Send Email Notification to Initiatorโ€™ Body template. Expression โ€˜TOP(ORDERBY(Select([Related P3 demands][P3 Demand ID]),TRUE),[_RowNumber],5)โ€™ is invalid due to: SELECT has invalid inputs. Error: Workflow rule โ€˜Send Email to Initiator for New Demandโ€™ action โ€˜Send Email Notification to Initiatorโ€™ Body template. Start expression โ€˜TOP(ORDERBY(Select([Related P3 demands][P3 Demand ID]),TRUE),[_RowNumber],5)โ€™ should generate a List of Ref values. Please verify that it generates a List and that the contents of the List are Ref values. Ref values should come from the โ€˜Keyโ€™ column of the referenced tableโ€ฆ

I mean this expression.

If it does not work, i m running out my help, hopefully the other community member would help you out.

yes i tried it but i got an error.

Failed: Action not performed because 2 errors are present. Error: Workflow rule โ€˜Send Email to Initiator for New Demandโ€™ action โ€˜Send Email Notification to Initiatorโ€™ Body template. Expression โ€˜TOP(ORDERBY(Select([Related P3 demands][P3 Demand ID],TRUE)),[_RowNumber]),5)โ€™ is invalid due to: Expression โ€˜TOP(ORDERBY(Select([Related P3 demands][P3 Demand ID],TRUE)),[_RowNumber]),5)โ€™ could not be parsed due to exception: Number of opened and closed parentheses does not matchโ€ฆ Error: Workflow rule โ€˜Send Email to Initiator for New Demandโ€™ action โ€˜Send Email Notification to Initiatorโ€™ Body template. Start expression โ€˜TOP(ORDERBY(Select([Related P3 demands][P3 Demand ID],TRUE)),[_RowNumber]),5)โ€™ should generate a List of Ref values. Please verify that it generates a List and that the contents of the List are Ref values. Ref values should come from the โ€˜Keyโ€™ column of the referenced tableโ€ฆ

Sorry, i made a typo probably.

this should be the one.

<<Start:TOP(ORDERBY(Select([Related P3 demands][P3 Demand ID],TRUE)),[_RowNumber],5)>>

OR

<<Start:TOP(ORDERBY(Select([Related P3 demands],TRUE)),[_RowNumber],5)>>

Hi,

Still not working.

<<Start:TOP(ORDERBY(Select([Related P3 demands][P3 Demand ID],TRUE),[_RowNumber]),5)>>

How about this instead?

Or

<<Start:TOP(ORDERBY(Select([Related P3 demands],TRUE),[_RowNumber]),5)>>

doesnโ€™t work

What if happens, if you place this expression into VC on the parent table? Get the correct set of rows?

Nothing happened. The result is still the same.

No more practical offers from my side. I only can suggest that you use virtual column to test your expression. Just start test with pieces of your whole expression to find out the root cause of the problem, typical debugging approach on your own.

I solved it! Thanks for all the recommendations

Good to hear you get out of the maze finally.

Consider removing everything else in your template (or create a new template solely for testing) while you figure this out, to ensure there isnโ€™t something else confusing the matter.

Top Labels in this Space