Can I use an <<If>><<EndIf>> expression inside a <<Start:>><<End>> expression?

I have an app that creates a job card for a team. Basically on each row is the date, between 1 and 5 crew members and between 1 and 10 jobs for that day - each job consists of a reference, client, site address and the work to be carried out.
The hours spent on each job by each crew member are also recorded.

There are around 15 teams each day.

My client now wants a single sheet PDF that lists this information for all the crews each day in a table - i.e. one* sheet per day showing all the crews/jobs.

I have a layout and a Start/End expression that shows all the teams and the jobs for the specified day - BUT it is also showing the empty job fields for each crew, so even if a crew has just had 3 jobs that day it’s showing empty space/cells for the 7 empty jobs.

I’ve tried adding an <><> expression inside the <Start:><> expression to not show any jobs where the work description is empty but that gives an unmatched ā€˜Start’ error.

Any thoughts on how to solve this or is the app set up incorrectly for this?

Yes, you can use <>/<> inside <>/<>.

Please post a screenshot of your template to include both the <> and <> blocks.

1 Like

Steve,
Well that’s good news!
The template is too big for a screenshot so here’s a shared version:
https://docs.google.com/document/d/1tpx7M6ysWAWquo4ZWvM573404elqCDVlrYlQTGDQDJI/edit?usp=sharing

It’s only got 3 jobs on it atm but would eventually need to potentially show 10 jobs.

Ignoring the IF statement issue it’s actually it’s still wrong as it’s displaying the data incorrectly but hopefully I can sort that. I suspect I’m going about the template in the wrong way :roll_eyes:

I’m also wondering whether it might now be better to change to app with each team having a row in it’s Teams table and each job being a row in a Jobs table with a link between each Team and it’s jobs for that day? :thinking:

I’m not inclined to follow links. Please post snippets showing the relevant portions.

Ahh, fair enough!

<> Expression:

First <> expression

First EndIf expression and second If Expression:

Second <> and <> expressions

(I’m using an If/EndIf expression for each job and each job is currently two rows of the table)

First of all, I imagine you don’t actually want all these table-column references:

Note that it should remain as you’ve used it in the SELECT() expression in the <> tag.

3 Likes

<<if:NOT(ISBLANK(Job 2 Work Undertaken))>> should be <<if:NOT(ISBLANK([Job 2 Work Undertaken]))>>. Note the addition of square brackets around Job 2 Work Undertaken.

3 Likes

Yes.

3 Likes

Thanks for the pointers Steve
(Should have noticed the error in the If statement before :roll_eyes: )

I’m looking into my options :+1:

1 Like

[quote=ā€œTedMā€]
I have an app that creates a job card for a team. Basically on each row is the date, between 1 and 5 crew members and between 1 and 10 jobs for that day - each job consists of a reference, client, site address and the work to be carried out. The hours spent on each job by each crew member are also recorded.

There are around 15 teams each day.

My client now wants a single sheet PDF that lists this information for all the crews each day in a table - i.e. one* sheet per day showing all the crews/jobs.

I have a layout and a Start/End expression that shows all the teams and the jobs for the specified day - BUT it is also showing the empty job fields for each crew, so even if a crew has just had 3 jobs that day it’s showing empty space/cells for the 7 empty jobs. I’ve tried adding an <> @TedM wrote:> > I’m also wondering whether it might now be better to change to app with each team having a row in it’s Teams table and each job being a row in a Jobs table with a link between each Team and it’s jobs for that day?

Decided that this is the better route - I have a question but that’s for another post

1 Like

Just to finish this off… I changed the app to create patent/child relationships between tables of Teams and Jobs.

All of not working nicely and I now know that you can use an If/EndIf statement in the template and that Start/End statements need to be on the same row of the table.