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 / Very Basic If Statemen...
Power Apps
Unanswered

Very Basic If Statement not working.

(0) ShareShare
ReportReport
Posted on by 228

Can anyone give me an idea why this is rendering an error:

 

If(NCAForm_1.Mode = FormMode.New, User().Email, Parent.Default)

 

ShondaT_0-1678307940696.png

 

The other issue I'm having is that my gallery will not filter on the user which is part of the solution the above code is in. 

 

I've set the variable onStart as required, but when I add the filter function to the gallery it returns no records. When I hover over the variable the message provided is "We didn't find any data."

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

    @ShondaT

    Coalesce(Parent.Default, User().Email)

    In New forms, Parent.Default is blank.

    Activate Named Formulas in the settings and in App.Formulas

    useremail = User().Email;

    You can then filter your gallery with useremail. 

  • ShondaT Profile Picture
    228 on at

    @Drrickryp  I'm so very sorry but I am not following what you're saying very well. This code appeared to work in one of Shane Young's videos. So I'm still at a complete loss. If you could explain further I'd really appreciate it.

  • NZ0090 Profile Picture
    317 on at

    @ShondaT Can you share what the error message is? Click on the x > Get help for this error

    NZ0090_0-1678324635530.png

     

  • Drrickryp Profile Picture
    Super User 2024 Season 1 on at

    @ShondaT

    Coalesce() reads its elements from left to right until it finds a non blank one) in new forms Parent.Default is blank but otherwise it will have a value. 

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 June Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 320 Most Valuable Professional

#2
11manish Profile Picture

11manish 210

#3
Valantis Profile Picture

Valantis 167

Last 30 days Overall leaderboard