Text page
Welcome to the third unit of the “Expanding my first scenario course” course.
By now you know what a filter is - this will be crucial for this unit, as you will spend some time expanding and enhancing your use of filters.
The aim for this unit is: explore the AND / OR option within filters.
If you have not completed the tasks in the previous unit Adding a filter, please ensure you do this now.
Text page w/portrait image
The current scenario you have built will filter data from the Weather app on to two separate paths:
- If the temperature is above 20, it will pass to a sheet named Above 20.
- If the temperature is equal to or below 20, it will filter to a different sheet named Equal to or below 20.
When you were configuring your filters previously, there were two options under condition that were purposely ignored. These are:
- Add AND rule
- Add OR rule
You are now going to implement both of these filters shortly.
Selectable image 2
Add AND rule
Using AND will add an additional level of passing criteria to your filters.
For your current scenario, your top filter will pass the data to the next module if the temperature is above 20. Using AND you could expand this to:
- Temperature is above 20
- AND Status = clouds
- AND Air humidity is greater than 50
The data will only be processed to the next module if it fulfills all three of the criteria.
Add OR rule
Using OR will add an additional option of filtering data.
For your current scenario, your bottom filter will pass the data to the next module if the temperature is less than or equal to 20. Using OR you could have additional options such as:
- Temperature is equal to or less than 20
- OR Status = rain
- OR Air humidity is less than 50
If the required data meets any of the criteria, it will be processed to the next module.
CAROUSEL - 6- IMAGE - PORTRAIT
You are going to expand on your current filters now – please complete each stage of this exercise.
Adding AND Filters
On the first filter that you labeled Temperature above 20, select the filter to open the configuration screen. Under your first condition, select Add AND rule. This will create another condition window.
Map Status in the first field. For your operator, select Text operators: Equal to. In the final field, type Clouds.
Note: The blue vertical line on the left side of the filter pop-up indicates that both conditions must be met. Click OK when you are finished.
Adding OR Filters
On the second filter that we labeled Temperature less than or equal to 20. Select the filter to open the configuration screen. Under your first condition, select Add OR rule. Like the previous step, this will create another condition window.
Map Status in the first field. For your operator, select Text operators: Equal to. In the final field, type Rain.
Note: The blue line down the side of the screen is now split into two; this indicates that either conditions can be met for the data to be processed. Ensure you update the label of your filter to Temperature less than or equal to 20. Click OK when you are finished.
Text page w/portrait image
You have now added another level of criteria to your filters within your scenario.
The top module will: Process data if the temperature is above 20 AND equal to clouds.
The bottom module will: Process data if the temperature is less than 20, OR equal to rain.
Following up on our previous concert analogy, this is like saying “You can enter if you have a ticket, and you are wearing shoes. If you are not wearing shoes but you have a ticket, you can’t come in!”.
The next step is to Run once - the output will vary based on what the weather is like where you are.
Text page w/portrait image
The last thing to do is to run the scenario by clicking Run once.
Depending on where you are in the world or at what time, you will get a different result.
The screenshot here reflects what happened when we ran our module.
Because the temperature was less than 20, it filtered to the bottom module.
Look closely at the filter icons; the bottom one reflects that one bundle of data was passed through this filter. The top filter did not meet the criteria, and therefore was not processed.
At this point we recommend duplicating your scenario and playing with other outputs; for example setting up additional tabs in your Google Sheet and adding criteria for different types of weather / temperature combinations.
Text page
This fully concludes the concepts of using filters in your Make scenario!
By now though you should have an understanding of:
- The AND / OR filter rules
- The difference between AND / OR
- How to visually identify these
This concludes this unit. When you are ready, move on to the next unit: Overview of scheduling.