Question

# How to Check if Webhook Input (example '21.Januar.2021') Date is not a Weekand Day

• 24 replies
• 142 views

Hey maybe someone knows...

my input of Webhook is for example ‘21.Januar.2021’ and i want to check if this day is not Saturday or Sunday...How can i do this?

This post has been closed for comments. Please create a new post if you need help or have a question about this topic.

### 24 replies

Userlevel 7
+14

Hi @Halim

One option would be to use the Formatter to convert the Date to a Day.

Then use a Filter Step in your Zap to check if the date is a Weekend.

Check out this help article: https://zapier.com/blog/zapier-formatter-guide/#datetime

Userlevel 5
+5

Hey @Halim,

thank you for your message. As @Troy Tessalone already pointed out there is quite some documentation around this. See for example also here:

It is taken from this article. You basically would work with Formatter and Filter to get this running. Maybe you can try to solve it? If you run into problems let us know :)

Hey @Troy Tessalone  and @Ennes ,

thx, it worked, but now i have the next Problem :)

“Weekend” is Fri After 15:00

“NotWeekend” is Mo till Fri (before 14:59)

Conditional  A Weekend is:

Sat or Sun or (Fri and After 15:00)

///////////////////////////////////////////////

Question : Is it possible to do Conditional A and B like IF and Else?

Example

if ( Sat or Sun or (Fri and After 15:00) ) {

do Actions in Conditional A

}

else {

do Actions in Conditional B (without asking again for Condition)???

}

/////////////////////////////////////////////////

If Question 1 is not possible:

How can i determin

“NotWeekend”  Mo till Fri (before 14:59)  ??

im sure “3-B-NotWeekend.PNG” is not right

THX

Userlevel 7
+14

@Halim

Try Paths in your Zap: https://zapier.com/apps/paths/integrations

FYI: Paths can be nested 3 levels deep.

Userlevel 7
+14

@Halim

https://zapier.com/help/create/customize/insert-the-time-your-zap-runs-into-a-field

@Troy Tessalone

I dont understand... I used Zapier paths, Look AT the pictures

Userlevel 7
+14

@Halim

Have you tried testing your Zap steps/logic?

Try manipulating the data points to cover the different use case and see how the Zap behaves.

@Troy Tessalone

is this possible or not, i dont understand?

if ( Sat or Sun or (Fri and After 15:00) ) {

do Actions in Conditional A

}

else {

do Actions in PATH B (without asking again for Condition)???

}

Userlevel 7
+14

@Halim

The way you have Paths configured should work.

You’ll need to test the Filter logic with data point values that are representative of the different use cases to verify the Filter logic is working as expected.

@Troy

ok mybe my english is not so good, you dont understand my question.

i will try again. :)

I understand Zapier PATHS..

Path A...You have to set conditions

Path B...You have to set conditions again..

My question:

Is there a way to only write Conditions in Path a...and if condition is not met go to PATH B without condition writing again? Like IF(a)...ELSE(b)??

Userlevel 7
+14

@Halim

That’s what you can achieve with Paths.

You’d setup each Path to be mutually exclusive, so it’d only proceed down 1 Path.

Each Path needs it’s own Filter conditions set.

@Troy Tessalone

But why i cannot skip Conditions in PATH B??

Userlevel 7
+14

@Halim

FYI: A triggered Zap can proceed down multiple Paths (0+) if the filter conditions are met, thus why each Path needs to have filter conditions set.

Plus a Zap Path action can have 1+ Paths and Paths within Paths.

@Troy Tessalone

This is PATH A...and its correct

AND THIS IS PATH B...i want continue if PATH A condition not met

@Troy Tessalone

ok , so it is not possible to do IF...ELSE with Path A and Path B...that was my question :)

Userlevel 7
+14

@Halim

When a Zap with Paths is triggered, the Zap will attempt to go down each Path, IF it passes the Filter conditions set in each Path.

You’ll need to make sure your Path A and Path B filter criteria are mutually exclusive so that a triggered Zap can only go down Path A OR Path B.

Userlevel 7
+14

@Halim It is possible to do an IF/ELSE if you configure the Filters steps of each Path correctly.

Example

Path A - Filter with X = TRUE

Path B - Filter with X = FALSE

This would allow a triggered Zap to only proceed down one path depending on the value of X

@Troy Tessalone

Troy, now i understand nothing..you said “no its not possible to do IF ELSE..” now you say that is possible.

you said it goes each Path down if the condition is met, so that would be not IF(path a) - ELSE (path b) ...this would be like IF(path a) - IF (path b)….am i right???

Userlevel 7
+14

@Halim

Troy, now i understand nothing..you said “no its not possible to do IF ELSE..” now you say that is possible.

To be clear, I never said it was not possible to achieve the IF/ELSE functionality with Paths.

All depends on how you configure the Filter conditions of each Path.

Paths can be configured to achieve IF/ELSE functionality if you set mutually exclusive Filter conditions for each Path.

EXAMPLE

Path A

Path B

There are 4 possible outcomes

1. Zap goes down NO Paths
2. Zap goes down Path A ONLY
3. Zap goes down Path B ONLY
4. Zap goes down Path A AND Path B

@Troy Tessalone

Yes and this is like if...if....there is no real if else ..right? that was my simple question.

I understand, you can imitate if else if you set the conditions in each path right.

@Troy Tessalone

the Problem in the PATH B is...I want to do this:

(not Sat AND not Sun) AND (yes Fri AND before 14:59)

but i can only do this in Zapier, right?

(not Sat AND not Sun) OR (yes Fri AND before 14:59)

like below

Do you know how i can achieve this  (not Sat AND not Sun) AND (yes Fri AND before 14:59)   ??

Userlevel 7
+14

@Halim

You can try using a Code step (note: more technical) to do the evaluation of conditions and output a simple Weekend/NotWeekend value to use in the Zap Paths.

https://zapier.com/apps/code/help

@Troy Tessalone

ok i will try thx

Userlevel 7
+14

@Halim

You could split the Paths in 3: A,B,C

Path A - Weekends (Sat/Sun) = TRUE

Path B - Monday-Thursday = TRUE

Path C - Friday = TRUE

Path C.1 - Before 5PM = TRUE

Path C.2 - After 5PM = TRUE