I am trying to select from one of 8 images in an email body template. The switch reads a value from the row generated by the form, but I want to select one of the images from only the first row in the sheet, as otherwise all 8 images would have to be loaded every time.
The switch statement doesn't work successfully, either the email automation doesn't happen, or if it does, it ignores the switch.
See below for the template code and the sheet layout.
Grateful for any help!
James
Solved! Go to Solution.
Oh this was solved by using a thisrow argument:
<<Start: SELECT(PlrTest[ID],[ID]=โ6f711588โ)>>
<<SWITCH([_THISROW].[ImageSelect],
1, [Image1],
2, [Image2],
3, [Image3],
4, [Image4],
5, [Image5],
6, [Image6],
7, [Image7],
8, [Image8],
""
)
>>
<<End>>
You're getting the syntax for swtich wrong
https://support.google.com/appsheet/answer/10107700?hl=en&sjid=1602890084699399089-EU
I'd be grateful if you could point out the error? I can't see that it's wrong, the first value is numeric, then it should choose the column value?
So the correct format should be
SWITCH(expression, case1, value1, [case2, value2 ...], default)
And I have
SWITCH(ImageSelect],1,[Image1], etc ... ""
ImageSelect column is of type Number.
1, 2, 3 etc are numeric values.
Image1 is the column containing the image that should load in the template?
Oh this was solved by using a thisrow argument:
<<Start: SELECT(PlrTest[ID],[ID]=โ6f711588โ)>>
<<SWITCH([_THISROW].[ImageSelect],
1, [Image1],
2, [Image2],
3, [Image3],
4, [Image4],
5, [Image5],
6, [Image6],
7, [Image7],
8, [Image8],
""
)
>>
<<End>>
SWITCH([Image Select],"Image 1",[Image 1],"Image 2",[Image 2]...,[Default Image])
In other words
IFS(
[Image Select]="Image 1",
[Image 1],
[Image Select]="Image 2",
[Image 2],
...
TRUE,
[Default Image]
)
User | Count |
---|---|
18 | |
15 | |
10 | |
7 | |
4 |