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 / Set Default Selected I...
Power Apps
Answered

Set Default Selected Items property Based on a Condition

(0) ShareShare
ReportReport
Posted on by 1,362

Hello and good morning Power App community,

So far the new year has been great thank God!
I hope things are going well for you as well.

My first post this year revolves around populating a person/group field with the default user that is logged in.
I have a field called "Requestor" and this field is pre populated with the current user: { DisplayName:User().FullName, Claims:"i:0#.F|membership|" & Lower(User().Email, Email: User().Email, Picture:""}

I also have another person/group field called "Request for Other" 
What I would like to do is display the current user only if the "Request for Myself" (Y/N) toggle is set "Y" and set it to blank, Null or "" if the "Request for Myself" is set to "N".
I was playing with the formula IsBlank If(IsBlank(DataCardValue3.Value, do something, dont do something)) but it doesnt work.

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

    At first glance the IsBlank is not quite right due to brackets. If(IsBlank(DataCardValue3.Value, do something, dont do something))

     

    next thing is DataCardValue3 a toggle, dropdown or combobox

     

    do you have screenshots of everything you are trying to filter by as IsBlank is not what i would use for a toggle.

  • golfnutt82 Profile Picture
    1,362 on at

    The toggle is a Y/N field
    I have two data cards

    Datacard1 = current user name and only visible when the toggle is set to "Yes"
    This field defaults to the current user
    Datacard2 = a manual person entry field and only visible when the toggle is set to "No"

    If the toggle is set to "No" then clear the Default value from DataCard1 else, dont change anything.

  • Verified answer
    AJ_Z Profile Picture
    3,711 Super User 2024 Season 1 on at

    is DataCardValue3 the name of the toggle? if not change the below to be the name of the toggle.

     

    change requestor which i believe is DatacardValue1 to default to 

    If(DataCardValue3.Value,{ DisplayName:User().FullName, Claims:"i:0#.F|membership|" & Lower(User().Email, Email: User().Email, Picture:""})

     

    make the visible of the DatacardValue2 into 

    !DataCardValue3.Value

     please remember i have assumed your toggle is called DataCardValue3 if it isnt try my suggestions but replace DataCardValue3 with the correct name for the toggle.

     

    Let me know how this goes 🙂

  • golfnutt82 Profile Picture
    1,362 on at

    I may have caused some confusion so I am clarifying now.

    The Y/N field is DataCardValue3

    golfnutt82_3-1641489253169.png

    golfnutt82_4-1641489297766.png

     

    The "Requestor" Person/Group field is DataCardValue6 

    golfnutt82_6-1641489420119.png

    golfnutt82_1-1641489035871.png

    Currently "DefaultSelectedItems" for DataCardValue6 is set as follows.

    golfnutt82_0-1641488940104.png

     

    The "Request for Other" is DataCardValue14

    golfnutt82_7-1641489555236.png

    golfnutt82_8-1641489663575.png

     

  • golfnutt82 Profile Picture
    1,362 on at

    I was able to resolve the issue with what you provided.
    Thanks for your help.
    Please disregard my last message.

  • AJ_Z Profile Picture
    3,711 Super User 2024 Season 1 on at

    No worries I am happy I was able to be of assistance 🙂

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 Launch!

Jump in, show your community spirit, and win prizes!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the May Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
Valantis Profile Picture

Valantis 483

#2
WarrenBelz Profile Picture

WarrenBelz 399 Most Valuable Professional

#3
11manish Profile Picture

11manish 327

Last 30 days Overall leaderboard