Hi @alexs
You may need to utilize some custom code in a Code step in order to determine this.
Code: https://zapier.com/apps/code/help
Logic
Logic would go something like this:
Check if 1st of the month is a weekday
If TRUE, then use
If False, then repeat for the 2nd of the month
… and so on for the first 7 days of the month
@alexs
OR you could create and maintain a lookup table in a GSheet or Airtable to serve a similar purpose.
Zap action steps
GSheets - Lookup Row
OR
Airtable - Find Row
Just wanted to follow-up here to suggest an alternative no-code solution as well. :)
Troy’s suggestions are correct here but for anyone that may not comfortable with writing code or building a lookup table containing the details for all first of the months that fall on a weekend Google Sheets, you can use our Formatter and Paths apps to achieve this.
To get the first day of the next month we need two Formatter steps, one to add a month to the current date ({{zap_meta_human_now}}) using the expression +1 month. Then set the To Format to output just the month and year using a custom value of MM/YYYY:
A similar process is discussed here:
Next, a second Formatter step is used to get the day of the 1st day of the next month. You’d do that by typing in “01/“ and selecting the next month and year value from the previous Formatter step:
This would output the name of the day as Mon, Tues, Wed etc.
Then ideally you’d use a Paths action to set up two Paths (Add branching logic to Zaps with paths). One that checks whether the output of the previous Formatter step contains “Sat” and the other to check if it contains “Sun”. This would indicate whether the 1st of the month is on a weekend.
Finally, in the step that creates the meeting, you’d select the month and year output from the first Formatter step and type either “02/“ or “03/“ in front of it. That would give you the first Monday of the next month.
For example for the “Sunday” Path you’d type in “02/”. And for the “Saturday” Path, you’d type “03/” in front of it to get the first Monday’s date. For example:
It’s also possible to achieve using a Filter instead of Paths by having two duplicate Zaps each checking for either “Sat” or “Sun”. But this would use additional Tasks compared to the version that uses Paths.