Email template

I have an email template as shown below, the user has a number of pictures against the area. I want the pictures to show 3 across but cant seem to work our how to do this or if indeed it is possible?

what i would like is

thanks

Getting the pictures into the format you have illustrated would be difficult.

What if you followed the first approach but placed the other details in same row as the picture? Such as :

<<Start: [Photos]>> <> <<[Date/Time]>> <<[Comments]>><>
3 Likes

Unfortunately the date/time & comments take up to much space even i reduce the column sizes it still means I have a load of wasted space.

I understand. What if you divided the page into 2 columns each column having the Image, Date/Time, Comment?

[Picture]

[Date/Time]

[Comment]

[Picture]

[Date/Time]

[Comment]

[Picture]

[Date/Time]

[Comment]

[Picture]

[Date/Time]

[Comment]

[Picture]

[Date/Time]

[Comment]

[Picture]

[Date/Time]

[Comment]

[Picture]

[Date/Time]

[Comment]

[Picture]

[Date/Time]

[Comment]

You would have a START/END for each column which means you would need to create the expressions for each column to divide the list of pictures.

Unfortunately, the templates operate on a row-based processing scheme. To get the original template format you suggested, I think is a LOT of work to try to make happen to accomodate an unknown number of pictures.

2 Likes

Hi, Thanks for your help on this, unfortunately I think I only have one option and that is the format below for now. It juts means the user can create 3 picture per record, not ideal but the only way I can do it so that they show in a row and there is no limitations.

BTW, this should be easily handled by display: flex on an html template.

Would you mind to try it?

1 Like

Yes i would be very interested to try

Download this file:

https://gitlab.com/SkrOYC/html-public-templates/-/raw/main/Templates/Flex%20with%203%20columns%20for%20img.html?inline=false

Then upload it to your drive and select it from the “Attachment template” section on the task of your bot.

If there are any warnings, please post an screenshoot

3 Likes

Another option is to create three lists of [Photos] , one each for 3 columns in the parent table. The sequence of photos in the report will be column wise.

  1. The expressions for 3 VCs of list of photos ( one for each column):
  • The expression for the 1st column of [Photos] list will be called say column [1stColumnPhotos], Expression for the column:

TOP([Photos], CEILING(COUNT([Photos])/3))

  • For second column list [2ndColumnPhotos] the expression will be

TOP([Photos]-[1stcolumnPhotos],CEILING(COUNT([Photos]-[1stcolumnPhotos])/2))

  • For third column list, [3rdColumnPhotos]

[Photos]-([1stColumnPhotos]+[2ndColumnPhotos])

If you do not want to create the VCs, you could push these expressions in the report template as well.

2.The report output will look like below ( tested on a similar setup as your requirement)

3. Your template for “photos” part will be something like

<Start:1stColumnPhotos>

<<[Picture]>>

<<[Date/Time]>>

<<[Comment]>>

<>

<Start:2ndColumnPhotos>

<<[Picture]>>

<<[Date/Time]>>

<<[Comment]>>

<>

<Start:3rdColumnPhotos>

<<[Picture]>>

<<[Date/Time]>>

<<[Comment]>>

<>

3 Likes

Hi, I am liking where this is going however I am getting an error on the first column [1stColumnPhotos]=TOP([photo], CEILING(COUNT([Photo])/3)) it is saying count function used incorrectly

Please below table

Thank you. Could you update, what is the type of column [Photo]

From the screenshots shared, you are using expressions at an incorrect place.

You need to use the expression for list type column you have mentioned [Photos] with the <<START…>> expression.

Since you have used [Photos] in the <<START…>> expression, the column has to be list type.

From your earlier details shared, I believe the [Photos] list type column is in a parent table. I have suggested to create columns in the parent table. Please refer the sentence below.

"Another option is to create three lists of [Photos] , one each for 3 columns in the parent table"

1 Like

Hi, ok so my template reads as below

and my table is as below.

So the expression in the template is now matching the table however the 3 VC’s I created are bringing up an error and seems to be the [1stColumnPhotos] which is causing this with the count function

Please read my the previous post.

Presume the [Photos] column is in “Site Audit” table. You need to create the 3 VCs in that table.

1 Like

Hi,

I have created 3 VC’s, had to add a reference to the table as below columns 2 & 3 are now showing but having issues with column 1 as its not showing the 1st photo.

[1stcolumnphotos] - list

Top(photos table[photo],CEILING(COUNT(photos table[Photo])/3))

[2ndcolumnphotos] - list

TOP(photos table[Photo]-[1stcolumnPhotos],CEILING(COUNT(photos table[Photo]-[1stcolumnPhotos])/2))

[3rdcolumnphotos] - list

photos table[Photo]-([1stColumnPhotos]+[2ndColumnPhotos])

May I know [Photos] column you originally shared in the <<START… >> expression is from which table?

You had not shared photos table[Photo] in the original post.

1 Like

My Photos Table contains the column photo as below, (I changed the table name to make it easier) ignore key column changed to picture ID

May I know from where you are invoking the report , from the parent table of the photos table?

Where is the Are: Main Cupboard field in the report coming from?

How do you decide what records from the Photos table to include in the report?

Typically reports have one record from the parent table and the multiple related records from the child table. The <<START…>> expression will depend on how your report is invoked-from the parent table with associated children records ?

1 Like

I have a parent table called main data to create a report and the user can then generate as many photos against that report.

Correct. That is what I was all along requesting and suggesting.

Please create the 3 VCs in the parent Main Data table using the [Photos] reverse reference column in that table in the VC expressions. Then your template should work.

Again please note what I mentioned in the first post itself

"Another option is to create three lists of [Photos] , one each for 3 columns in the parent table"

1 Like

Ok, I was completely ignored with this :joy:

2 Likes