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 / If Statment does not w...
Power Apps
Unanswered

If Statment does not work in DefaultSelectedItems (Dropdown) when using User.Email

(0) ShareShare
ReportReport
Posted on by 53

In My Powerapp there is a Dropdown option (SP) which could be filled in by Powerapps.

 

I get an error Message when using this Statment, what is the issue?

If(User().Email = "mail@company.com" ; "res 1") 

 

Categories:
I have the same question (0)
  • RusselThomas Profile Picture
    4,014 on at

    Hi @KT03 ,

    You need to specify the result of DefaultSelectedItems in a construct that conforms to your Items: property input. 

    In other words, if the Items: property is a table of values, then the result of DefaultSelectedItems must be in the format of a table, containing a record or multiple records from that table (not just a value).

     

    So, let's say your Items: property is a collection called myCollection which looks like this;

    Value
    res 1
    res 2
    res 3

    And you want the default to be the first record, then your DefaultSelectedItems: property would be;

     

    If(User().Email="mail@company.com", First(myCollection))

     

    The control is already configured to show the column you want to display, so you must only specify the records/rows (not the column or field) and it will do the rest.  If you wanted a different row, you could just use a lookup - or multiple rows, a filter that results in the rows you want selected - for example;

     

    //LookUp Example (single default selected item)
    If(User().Email="mail@company.com", LookUp(myCollection, Value = "res 2"))
    
    //Filter Example (multiple default selected items)
    If(User().Email="mail@company.com", Filter(myCollection, StartsWith(Value, "res")))

     

    Hope this helps,

    RT

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