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 / Is there a way to clea...
Power Apps
Answered

Is there a way to clear out datacardvalue2 in an edit form if datacard value2 choice is changed?

(0) ShareShare
ReportReport
Posted on by

Hi all,

 

I have a workflow app, with an editable form that writes back to a SharePoint list.

 

One of the datacards links to a Team with two choices (choice field):

Team A 

Team B

 

There is a second datacard that links back to a people column in SharePoint.

 

I have been asked to ensure if the team changes in datacardvalue1, then it clears the person listed in datacardvalue2 (but obviously no change if the form is edited but the team remains the same).

 

Any suggestions on the best way to execute this?

 

Thanks,

 

DW

Categories:
I have the same question (0)
  • WarrenBelz Profile Picture
    154,797 Most Valuable Professional on at

    Hi @DGWolfe ,

    in the OnChange property of the first control reset the second control 

    Reset(DatCardValue2)

     

    Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

    MVP (Business Applications)   Visit my blog Practical Power Apps

     

  • DGWolfe Profile Picture
    on at

    @WarrenBelz thank you. I did try this but the name remains the same. Could it be because datacardvalue 2 is linked to a person column? Not sure why it's failing?

  • WarrenBelz Profile Picture
    154,797 Most Valuable Professional on at

    @DGWolfe ,

    Resetting a control either directly or by a Variable trigger in its Reset function sets it back to its Default value, which may not be blank (except if the Form is on New Mode). What are the current Items and DefaultSelectedItems (I assume this is a Combo Box).

  • Ethan_009 Profile Picture
    4,838 Moderator on at

    Hi @DGWolfe ,

     

    Do you have anything in the Default property?

    Reset will restore to default value.

    If you clear that out, then it might work.

     

    Edited: Noticed you updated the same. @WarrenBelz  😅

    Hope this helps

  • DGWolfe Profile Picture
    on at

    @WarrenBelz 

    DefaultSelectedItems = Parent.Default.

     

    Default = blank/empty.

     

  • DGWolfe Profile Picture
    on at

    @Ethan_R thanks, but I kept my default blank. So, still not sure why its failing.

  • WarrenBelz Profile Picture
    154,797 Most Valuable Professional on at

    @DGWolfe ,

    It is the DefaultSelectedItems that is doing this - what is the Items property and what is the name of the Person field you are displaying ?

  • DGWolfe Profile Picture
    on at

    @WarrenBelz 

     

    Person field name: Assignee

    Items = Choices({@SPLIST].Assignee)

  • Verified answer
    WarrenBelz Profile Picture
    154,797 Most Valuable Professional on at

    @DGWolfe ,

    OK - you also need to be careful with this as you could easily delete existing data. OnChange of the first control put this

    UpdateContext({varReset: false});
    UpdateContext({varReset: true})

    On the Reset of the second Control

    varReset

    At Screen OnVisible and at the end of your form save code

    UpdateContext({varReset: false})

    and lastly your DefaultSelectedItems

    If(
     !varReset,
     Parent.Default
    )

    Note that if the user saves the form without entering anything in the second box, you will delete the existing data in your list record field.

     

    Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

    MVP (Business Applications)   Visit my blog Practical Power Apps

  • DGWolfe Profile Picture
    on at

    @WarrenBelz legend as always! Thank you! It was the last two actions I didn't have that solved the issue 🙂

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Congratulations to the March Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 505

#2
WarrenBelz Profile Picture

WarrenBelz 502 Most Valuable Professional

#3
Haque Profile Picture

Haque 324

Last 30 days Overall leaderboard