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

Notifications

Announcements

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

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 721 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 320 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard