Please help. Simple question on displaying reference values in word template

Hi Guys.

I have been working with Appsheet for a while now and am progressing slowly in getting to know the platform. I am struggling to figure out, through all the help available, how to make a relatively simple expression in my template work.

I have two tables. One is for Incidents Reported (“Incidents”). The second is for actions that are related to each of these incidents (“Actions”). In the Actions table I have a column called [Incident no.] which refers to the [uniqueID] column in Incidents via the REF column type.

All works perfect in the app. For each incident I am able to load many actions. But now I want to include all those actions in a template under certain conditions. I am struggling to figure out how to use the “Start::” expression and how to refer to different tables and their links to each other. I am triggering the vent from a completed form in the Incidents table. What expressions do I use to list those actions in the template?

Your help would be highly appreciated.

Regards
Gerhard

Hello @Gerhard_Viljoen, i know that feel, workflow templates can be tough to work with at first.

First things first, the “Start:” expression is going to be evaluated from the perspective of your Incidents table, the result of the Start expression should be the list of keys from the rows you want to display.

Since you have a REF column from your Actions table to your Incidents table, you should have a “Related Actions” column in your incidents table, if you’d like to show those, the expression is as follows:

<<Start: [Related Actions]>>

Using the “Related Something” columns in this way will automatically generate the list of child rows for the parent row you’re running the workflow from, and it will also point towards the Actions table for the expressions inside the “Start:” and “End”.

The expressions contained between <<Start: [Related Actions]>> and <<End>> will be evaluated from the perspective of the Actions table, so you could type in your column names in order to display a simple list of items, or perform any operations you would like, those will be evaluated for each row of your [Related Actions].

1 Like

Thank you very much.

I just needed that exact context. To know that once I have opened the [Related Actions] with Start, that I am then working inside that table’s columns until the expression ends. Thanks a mil!

Can I ask you one more favour. I also want to include a slice where it only shows the rows of Incidents where all its [Action] values in the Actions table are TRUE. How do express that in my formula with all my other column conditions (in an AND statement)?

2 Likes

Your Start: expression could be pretty much anything, as long as it ends up in a list of keys, it will also direct the other expressions to the table from where the keys are pulled.

That means you could use a SELECT() expression to pull the keys directly from your slice using the parent row ID as a filter, or avoid the use of the slice altogether by doing the SELECT() directly on your original child table.

If you need to test your Start: expression you can create a virtual column in the table where the workflow is running from, if the expression asistant can run it, the workflow surely will.

1 Like

Thanks Rafael.
The context for my second question is actually different. I’m now just talking about setting up the slice in the Slices editor. How does one go about validating a list of values that should all be true in the reference table? i.e. I want to make sure all some values in the Incidents table are true as well as all the actions that are part of that row in the Actions table?

1 Like

You can use the “Row filter condition” box to write the expressions that would give you the filtered rows of your choice, could be as simple as [STATUS]=TRUE.

That would be it for slicing up your parent table, but if you want to show only filtered rows for your child tables as well, you would need to slice the child table using the same method, and then adding a ref column in your parent table that uses the same “Related something” formula called ref_rows() but pointing towards your child table slice.

That’s in case you want to show the filtered parent tables and their filtered inline views of their child tables, if that’s not what you had in mind let me know.

1 Like