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

Community site session details

Session Id :
Power Apps - Error Handling
Suggested answer

If statement problem

(0) ShareShare
ReportReport
Posted on by
I keep getting an "Expected operator" error in the following. The SendEmail bit is nearly identical to code that functions correctly on another screen of the app. I just can't figure out what is wrong with the If statement. Bulk_Location_Menu is a dropdown. Can anyone see where I went wrong?
 
 
If(
    Bulk_Location_Menu.Selected.Value = "Front Reception",
    Office365Outlook.SendEmailV2(
        "email@email.com",
        "Package Delivery From Central Receiving",
        "Delivery Location: Front Reception- Room 120" & "<br><br>" &
        "Notes: " & NotesBox.Text & "<br><br>" &
        "Tracking Number (if available): " & BarcodeScanner1.Value & "<br>" & "Arrived via: " & Label3.Text & "<br><br>" &
        "This is an automated notification. To inquire about this delivery, you may reply to this message.",
        {
            From:"otheremail@email.com"
        }
    )
)
I have the same question (0)
  • Suggested answer
    Michael E. Gernaey Profile Picture
    47,123 Super User 2025 Season 2 on at
    If statement problem
     
    When ever you have an error it is good to show the code with the error itself as well.
     
    Without seeing the Data and Control values, I would simplify.
     
    For the Body, just as a test, copy what you have, save it, then for the body just put "Body" and see if the error goes away.
     
    Secondly, the From, do you have permission to send from that? Normally you would not include the From because it defaults to the user who is sending. If you want it to be from someone else, make sure that the people sending have permission to send on behalf.
     
    I am actually wondering if its the Barcode, as I have seen many issues with that.
     
    But if you can narrow down, to if its the Body, then you can simply add parts of the body back until it gives you the error.
     
    I think if you simply go step by step with the body you will find it.

    If these suggestions help resolve your issue, Please consider Marking the answer as such and also maybe a like.

    Thank you!
    Sincerely, Michael Gernaey

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

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Telen Wang – Community Spotlight

We are honored to recognize Telen Wang as our August 2025 Community…

Congratulations to the July Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 637 Most Valuable Professional

#2
stampcoin Profile Picture

stampcoin 570 Super User 2025 Season 2

#3
Power Apps 1919 Profile Picture

Power Apps 1919 473

Featured topics