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 / Warning message on If ...
Power Apps
Unanswered

Warning message on If function

(0) ShareShare
ReportReport
Posted on by 58

I have the following function that is giving me a warning message that I cannot figure out

 

If(NewDiaryIssueDD.Selected.Value=!"Machine Fault (Controls)", Patch(ProcessDiary, Defaults(ProcessDiary), {Title: User().FullName, Date: Now(), AreaCell: NewDiaryItemAreaLbl.Text, Issue: NewDiaryIssueDD.Selected, SafetyRisk: NewDiaryItemSafetyDD.Selected, JITNonJIT: NewDiaryItemJITDD.Selected}); Navigate(StartingOptions), Patch(ControlsDiary, Defaults(ControlsDiary), {Priority: NewDiaryPriorityInput.Selected, ProcessDiaryID: VarX, RequestedBy: CurrentUser}))

 

I'm used to Excel functions, which is why my statement is a single line, but having said that, the warning message is as follows:

 

Cathleen307_0-1639840818855.png

 

Categories:
  • dgatewood Profile Picture
    34 on at
    Try <> instead of =!
  • dgatewood Profile Picture
    34 on at

    Also noticed the CurrentUser, I would ultimately replace that as User().DisplayName or User().Email. I'm guessing that's already being done by a variable but for performance eliminating repititive set functions that are Delcarative

  • Bilakanti Profile Picture
    1,226 on at

    @Cathleen307 

    1. Syntax to check not equal to condition within IF statement is "If( a<>b,true,false)".
    2. From the above If condition in the screenshot, you are comparing two different datatypes, Text and Boolean. Please check your comparison once.

  • timl Profile Picture
    37,287 Super User 2026 Season 2 on at

    @Cathleen307 

    I agree with @dgatewood 

    The inequality operator is <>, rather than =!. So if the target predicate of your If statement is test that NewDiaryIssueDD.Selected.Value isn't equal to "Machine Fault (Controls)", the correct syntax would be:

     

    If(NewDiaryIssueDD.Selected.Value <> "Machine Fault (Controls)",
     Patch(ProcessDiary,.....

     

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
11manish Profile Picture

11manish 394 Super User 2026 Season 2

#2
Mohsin Ali Profile Picture

Mohsin Ali 328

#3
WarrenBelz Profile Picture

WarrenBelz 324 Most Valuable Professional

Last 30 days Overall leaderboard