web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Boolean logic "And", "...
Power Apps
Unanswered

Boolean logic "And", "&&&&" functions incorrect work

(0) ShareShare
ReportReport
Posted on by 6

Hello everyone!

 

I have IF function and in this condition I have incorrect operation of the "AND" operator. As you see all condition return true

bezdelnik_0-1636043614168.png

If select arguments separately we saw that one argument gives false and other true:

bezdelnik_1-1636043849936.png

bezdelnik_2-1636044030098.png

Why all condition gives true?

 

If change JS syntax to Function same issue:

bezdelnik_3-1636044214948.png

 

Categories:
I have the same question (0)
  • RandyHayes Profile Picture
    76,299 Super User 2024 Season 1 on at

    @bezdelnik 

    Please consider changing your Formula to the following:

    If((Weekday(startTime, StartOfWeek.Monday) < 6) && !(LookUp('Days Off', 'Day Off' = startTime, true)), ......

     

    See if that make a difference for you.

     

    I hope this is helpful for you.

  • ledarchenko Profile Picture
    6 on at

    The same

    bezdelnik_0-1636046017158.png

    And Weekday argument still false separately

    bezdelnik_1-1636046086711.png

     

  • RandyHayes Profile Picture
    76,299 Super User 2024 Season 1 on at

    @bezdelnik 

    I've seen that odd behavior before and it always seems to end up being something wrong in the overall formula.

     

    You can try to pull this into a separate scoped action.

    ex.

    Body: 
     With({_weekDay: Weekday(startTime, StartOfWeek.Monday),
     _item: LookUp('Days Off', 'Day Off' = startTime)
     },
     If((_weekDay < 6) && IsBlank(_item.ID), ...... )
     ),
    ....
     

    See if that sheds any light on it.

  • ledarchenko Profile Picture
    6 on at

    Selecting condition not show result bellow now. Also I get errors with my "ThisRecord" variable:

    bezdelnik_1-1636048954870.png

     

     

  • RandyHayes Profile Picture
    76,299 Super User 2024 Season 1 on at

    @bezdelnik 

    Yes, I would avoid the ThisRecord in most cases anyway as it will usually refer to a record other than what you expect.

    Yes, you will not be able to see the result of a highlighted section like you have in the editor as _weekDay is out of context for it as it is defined in the scoped With variable.  But you can highlight the formula in the With definition.

     

    Can you share the entire formula so that I can get a sense of the whole thing in context?

     

  • ledarchenko Profile Picture
    6 on at

    It just notification when you book workplace in office. I have two templates, for weekend and holidays and for work days

    bezdelnik_1-1636050342722.png

     

     

  • RandyHayes Profile Picture
    76,299 Super User 2024 Season 1 on at

    @bezdelnik 

    Actually, it is still out of context as it is only that part of the formula.  If you can copy the entire formula and present that.

    If you don't want to post it directly in a public forum, you can send a private message to me (through the forum email icon at the top) with it in so I can see the whole context and help from there.

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the July Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 329 Most Valuable Professional

#2
11manish Profile Picture

11manish 209 Super User 2026 Season 2

#3
Mohsin Ali Profile Picture

Mohsin Ali 179

Last 30 days Overall leaderboard