Template Start Expressions

Hi there,

I'm trying to create an email report where I have a template attachment and using <<Start>>. I want to create a multicolumn list in the pdf attachment, so have been working from 'Custom Reports' and 'Order Capture-How To' templates as reference.

I've created a Reports table within my app where a user can chose a value to limit the records in the report to those they need from the main table. That appears to be working fine in that the SELECT function in a virtual column ReportListItems returns a list of values from the Key field of the main table. (It's type Text). Typical values returned are ASD1-1 , ASD1-2 , ASD1-3 ...

When I use the <<Start:>> expression in an email attachment template, I get the following error

 "Start expression '[ReportListItems]' 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." 

The error message cheerfully displays ReportListItems [List] above a list of values from Key column of the main table.

So, the question I'm asking is, do 'Ref Values' in this context have to be from a field of type 'Ref' - which is difficult to set up in an app just one large table? In other words, does Start Expression only work on referenced tables?

Hope that all makes sense and any help gratefully received.

 

Solved Solved
0 4 1,771
1 ACCEPTED SOLUTION

According to this

https://help.appsheet.com/en/articles/961746-template-start-expressions

I believe the follwoing is what you need assuming your bot is based on the Report table...

<<Start: SELECT(main_table[key], IN([key], [ReportListItems]))>>

The template does not recognize  [ReportListItems] as containing a list of keys to the main table because your VC does not reference the main table,  just a list of text values (copies of the main table key values selected)

I could be wrong...

View solution in original post

4 REPLIES 4

I'm not an expert so I can just relate my experience with the platform.

I would say that if your start expression is actually pulling a list of key values by using a column, maybe you haven't configured that column correctly.

Please tell us the column type of [ReportListItems].

Also, post here your Select() expression. I suspect this may be the problem and you may be selecting a column that's not the key value of the targeted table.

Also, explain a little bit better why you need a Virtual Column for this, maybe we can help you making a better system for your need

According to this

https://help.appsheet.com/en/articles/961746-template-start-expressions

I believe the follwoing is what you need assuming your bot is based on the Report table...

<<Start: SELECT(main_table[key], IN([key], [ReportListItems]))>>

The template does not recognize  [ReportListItems] as containing a list of keys to the main table because your VC does not reference the main table,  just a list of text values (copies of the main table key values selected)

I could be wrong...

@TeeSee1 That worked! No more error message. Many thanks for this and @SkrOYC also, many thanks for taking the time to suggest a solution. I deeply appreciate both your suggestions.

Sure, as I said you need to make sure you are pulling the keys.

In that sense, I suggest to use FILTER() instead of SELECT(). FILTER() takes the key values, while with SELECT() you can take any column, which might confuse you when using it on Start: expressions

The syntax is almost the same, but FILTER() doesn't receive a column after the table name.

https://help.appsheet.com/en/articles/2357308-filter

Top Labels in this Space