Problem with PDF template IF Expression for Showing Columns

 

I've attempted to use IF in my template to hide certain columns if they are TRUE.

These are my attempts

<<If: ([Check End Of Day Report Has Been Completed?]=FALSE)>>Check End Of Day Report Has Been Completed?: <<[Check End Of Day Report Has Been Completed?]>><<EndIf>>

 

<<If: ([Check End Of Day Report Has Been Completed?]="FALSE")>>Check End Of Day Report Has Been Completed?: <<[Check End Of Day Report Has Been Completed?]>><<EndIf>>

 But I get the following error for each of my columns

Error 4 : Task 'Create Negative PDF' Body template. Expression 'If: ([Check End Of Day Report Has Been Completed?]=FALSE)' is invalid due to: Unable to find function 'IF:', did you mean 'IF'?.

Where am I going wrong?

0 9 149
9 REPLIES 9

Steve
Platinum 4
Platinum 4

The first one (=FALSE) should work, but the second (="FALSE") is definitely wrong.

Please post a screenshot of your template showing the general area where you're using the template-if tag so we have some context.

Screenshot (182).png

Thanks Steve, FYI, this link in the post is broken.

https://www.googlecloudcommunity.com/gc/AppSheet-Q-A/Hyperlink-in-emailed-workflow-pdf-only-if-isnot...

I found the documentation by googling it after seeing the address though so it was still helpful.

Regarding the screenshot, I have about 25 questions and the structure is the same for all of them.

This might be a problem:

Steve_0-1664214830241.png

Note the trailing space in the first reference but not in the second. That might cause a problem.

Y/N columns doesn't need you to compare them to anything, I prefer using NOT([Y/N]) when I need to check if it's false.

Try:

<<If:NOT([Check End Of Day Report Has Been Completed?])>>Check End Of Day Report Has Been Completed?: <<[Check End Of Day Report Has Been Completed?]>><<EndIf>>

I tried this...

<<If:NOT([Check End Of Day Report Has Been Completed?])>>Check End Of Day Report Has Been Completed?: <<[Check End Of Day Report Has Been Completed?]>><<EndIf>>

Got this...

Error 4 : Task 'Send Email with notes and PDF' Attachment template. Expression 'If:NOT([Check End Of Day Report Has Been Completed?])' is invalid due to: Unable to find function 'IF:NOT', did you mean 'FIND'?.

I also went back and renamed all my columns to remove special characters etc and thought I was on to something but I got the following error again

 

Task 'Create Negative PDF' Body template. Expression 'If:NOT([Check_End_Of_Day_Report_Has_Been_Completed])' is invalid due to: Unable to find function 'IF:NOT', did you mean 'FIND'?.

You could try

<<IFS(NOT([Check_End_Of_Day_Report_Has_Been_Completed]) ,"Check End Of Day Report Has Been Completed?: " )>> << IFS(NOT([Check_End_Of_Day_Report_Has_Been_Completed]) , [Check_End_Of_Day_Report_Has_Been_Completed]>>

or alternatively

<<IFS(NOT([Check_End_Of_Day_Report_Has_Been_Completed]) , CONATENATE("Check End Of Day Report Has Been Completed?: " , [Check_End_Of_Day_Report_Has_Been_Completed] ))>>

Could you share your whole template? An screenshoot would be enough.

Sometimes these errors are there when the expression can't find the <<EndIf>>

Hi everyone, thanks for the assistance. I built this app when I first started in Appsheet and all my columns had special characters etc. So I went back to the drawing board and removed all of them and now it seems to be working.

I now have a lot of gaps in my results. Is there a way to not have gaps where I don't show items.

Will a nest if expression solve it?

 

Top Labels in this Space