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 / DefaultSelectedItems n...
Power Apps
Answered

DefaultSelectedItems not setting value

(0) ShareShare
ReportReport
Posted on by 79

Hello, I have an issue with setting the DefaultSelectedItems.

 

I am using an If  function to determine whether the selected value contains the text _EMAIL

 

I get a true and then perform a lookup on the choice (dropdown) to set the desired DefaultSelectedItems Value E-mail or Mobile.

 

 

 

If(
 LookUp(
 Choices([@Requests].VPNGroup),
 "_EMAIL" in txtVPNGroup.Selected.Value,
 true
 ),
 LookUp(
 Choices([@Requests].VPN),
 Value = "E-mail"
 ),
 LookUp(
 Choices([@Requests].VPN),
 Value = "Mobile"
 )
)

 

 

 

Unfortunately it isn't setting anything.... 

 

Ideally what I would like to do is set E-mail if the selected value contains _EMAIL set Mobile if the selected value does not contain _EMAIL if the selected value is blank / empty then it should be parent.default.

 

What am i doing doing wrong ? Is there a better way of doing this ?

 

Any help appreciated.

 

THANKS

Categories:
  • Verified answer
    RandyHayes Profile Picture
    76,299 Super User 2024 Season 1 on at

    @DDM 

    What is the Items property of your combobox??  

    The DefaultSelectedItems property (DSI) must match the exact same record schema as the records of the Items property, or nothing will be matched.

     

     

  • DDM Profile Picture
    79 on at

    Ahhhhh......

     

    Right on the money..... It was

     

     

    Choices([@Requests].VPNTokenType)

     

     

    Thank you for pointing me in the right direction. Struggled for hours with it. I really don't know why i set it as VPN. 

     

    THANKS

  • DDM Profile Picture
    79 on at

    Final Solution for anyone who may face something similar:

     

    If(
     LookUp(
     Choices([@Requests].VPNGroup),
     "_EMAIL" in txtVPNGroup.Selected.Value,
     true
     ),
     LookUp(
     Choices([@Requests].VPNTokenType),
     Value = "E-mail"
     ),
     If(
     !IsBlank(txtVPNGroup.Selected.Value),
     LookUp(
     Choices([@Requests].VPNTokenType),
     Value = "Mobile"
     ),
     Parent.Default
     )
    )

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

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 405 Super User 2026 Season 2

#2
Mohsin Ali Profile Picture

Mohsin Ali 368

#3
WarrenBelz Profile Picture

WarrenBelz 244 Most Valuable Professional

Last 30 days Overall leaderboard