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

Community site session details

Session Id :
Power Apps - Power Apps Pro Dev & ISV
Answered

Empty people picker fields (not reset!)

(1) ShareShare
ReportReport
Posted on by 64
Good morning everyone.
I am having this problem in this app where a user can choose a number of DEC needed. DECs are people, tied to single-choice People picker fields (comboboxes) .
Basically I would like that, once I have chosen the number of DEC needed (via the How Many field), the program automatically EMPTIES the unnecessary fields.
So if I select 4 dec, but then decide that I only need 2, the program should empty the fields related to dec3 and dec4.

I used the reset formulas in the OnChange event of the How Many field and the Default and DefaultSelectedItems formulas in the various fields related to DEC (percentage is a  simple text field).
Everything seems to work: when I change the number of dec needed, the fields are emptied and when I save everything is ok in field's values.

The problem arises when I then reopen a saved record: the fields are ALWAYS empty!
 
I guess it's due to the DefaultSelectedItems and Default formulas: how should I set them?

Thank you
 
 
 
 
I have the same question (0)
  • Suggested answer
    Nandit Profile Picture
    1,568 Moderator on at
    Empty people picker fields (not reset!)
     
    I think what you mean is this (correct me if I am wrong)
    1. When user will change the How Many from 4 to 3: Empty DEC4
    2. But if they again select 4 in How Many (without saving): It should display the existing values?
     
    Also, because you have emptied it once, when you select any other item, DEC4 doesn't display anything. Is my understanding of your issue correct?
     
    I think in the DefaultSelectedItems property of DEC4, you need something like:
    If(Value(HowMany.Selected.Value) = 4, [], ThisItem.DEC4Column)
    
    Hope this helps. Let me know how it goes. 
     
    Kind regards,
    Nandit
     
    If this answers your query, please mark this response as the answer.
    If its helpful, please leave a like. Thanks!
     
  • Nandit Profile Picture
    1,568 Moderator on at
    Empty people picker fields (not reset!)
    Hi,

    Following up to check if you were able to solve this issue using my suggestion?

    Kind regards,
    Nandit
  • Verified answer
    AndreaPRJ Profile Picture
    64 on at
    Empty people picker fields (not reset!)
    Hi Nandit
    I probably hadn't explained myself well
     
    I needed the fields to always be emptied in case either the DECs were not needed at all, or in case I had chosen a particular number of decs (2 decs necessary? then will you empty the third one, 1 dec only? then you empty me both dec 2 and dec 3)
     
     
    in the end I did it like this and I solved : I removed HowMany DECs field, I left only the 4 thrash icons visible next to the 4 fields (always visibles) and in the onSelect of the icons I put:
     
    for example for thrash icon for DEC1 fields:
      UpdateContext({locResetControlsDEC1:true});Reset(DataCardValue_DEC1);Reset(DataCardValue_DEC1%)
     
    and then in the DefaultSelectedItems of DEC1 People Picker field I put:
     
     If(locResetControlsDEC1, Blank() ,Parent.Default)
     
    I also added this in OnVisible property of my SharepointForm
     
     UpdateContext({locResetControlsDEC1:false})
     
    Start situation
     
    End situation when I press thrash icon(s)
     
     
    regards

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

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Chiara Carbone – Community Spotlight

We are honored to recognize Chiara Carbone as our Community Spotlight for November…

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 686 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 433 Super User 2025 Season 2

#3
wolenberg_ Profile Picture

wolenberg_ 266 Moderator

Last 30 days Overall leaderboard