Need some expression & function help


#1

1) Give a description of the problem
I need someone to help me with this piston that’s better at expressions than I am (I suck at expressions). I want to get a notification with proper English when my PWS detects rain and there are one or more windows open.

2) What is the expected behavior?
If it starts raining and 1 window is open, I get a notification that says “It’s raining and Window A is open.”
If it starts raining and multiple windows are open, I get a notification that says “It’s raining and Window A and Window B are open.”

3) What is happening/not happening?
The problem is that no matter what, even when there is only 1 window open, I get a notification that says “It’s raining and Window A are open.” I’ll admit I know very little about expressions and functions.

4) Post a Green Snapshot of the piston!


#2

I should mention that I chose to evaluate on “and” because when there are multiple windows open, WindowStatus will show something like “Window A and Window B”.


#3

You can try the count(variableName) instead.

count(variableName) > 1 ? 'are' : 'is'


#4

That worked very well. Thank you!