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 / Datacard dropdown in E...
Power Apps
Unanswered

Datacard dropdown in Edit mode form not allowing to unselect value

(1) ShareShare
ReportReport
Posted on by

Hi,

 

I'm having an issue with a form in edit mode and I could use some help.

I have a sharepoint list with different records, let's call it CasesList. I have a canvas app connected to that sharepoint list. This app has a gallery from which I can select an item from that sharepoint list. Then, I have a form in edit mode, where I can edit the item selected. In that form, I have a couple datacards that appear as dropdowns, since they are lookup columns on my sharepoint list CasesList, allowing me to select a value from another list, let's call it UserList. 

This is my Items property on the datacard: Choices([@CasesList].User)
This is my DefaultSelectedItems property on the datacard: ThisItem.User 

 

The reason I have this DefaultSelectedItems property is because of two reasons:

  1. When I enter the edit form, I need to be able to visualize the current value on that record, besides allowing me to change it
  2. When I enter the edit form, if I don't make any changes in that field, I need the current data to stay the same. 

The issue is the following:

  1. I select the item from the gallery and navigate to the edit form screen
  2. I see the current value for that record within the form, 
  3. I don't want to only change the value for another value, but also be able to "unselect" it, so I can remove the value and save that field empty instead, in cases where I need to remove that value. 

For some reason, the dropdown datacard (which isn't multi-select), does not allow to unselect the options, not allowing me to "clear" that field in order to save it empty. 
From my CasesList in sharepoint I confirm the field does not require to contain information, does not enforce unique values and does not allow multiple selection. 

I tried a pretty messy workaround, that didn't work:
If(DataCardValue.Selected.Value = ThisItem.User.Value, Set(changed, true)) --> To "fake" the unselect. If I open the dropdown and select the same value that is currently in the data, changes the variable "changed" to true. Then, on the defaultSelectedItems, I added:
If(!changed, ThisItem.User)

This wasn't enough, the dropdown would clear visually, but on the backend let's say, it kept the same value so when I submitted the form, it would still keep the same value instead of removing it. 

Any ideas on how to fix it?

Thanks 

Categories:
I have the same question (0)
  • Ami K Profile Picture
    15,687 Super User 2024 Season 1 on at

    @MicaBassi - a LookUp field added as a DataCard into an EditForm control will work out of the box - there is no need to modify anything,

     

    A DataCard does not have a DefaultSelectedItems property, but there is a Default property which should contain:

     

    ThisItem.User

     

    The DefaultSelectedItems property should contain:

     

    Parent.Default

     

    Is there a specific reason you have made modifications to the DataCard and the ComboBox control? (out of the box, a CombBox control is generated, not a Dropdown control).

  • MicaBassi Profile Picture
    on at

    Hi @Amik,

     

    Thanks for your response. On the datacard Default property I already have "ThisItem.User".
    The datacard is associated to a lookup column in sharepoint, so when I added that field to the form, it automatically added it as dropdown datacard (or is it a combobox?)

    So for the dropdown/combobox of the datacard, on DefaultSelectedItems, I changed it to Parent.Default as you mentioned. Still it doesn't solve the issue of the datacard not allowing me to "unselect" that value and save the field empty. 


    I'm sharing a screenshot here, of the datacard User with the dropdown, if I open it, you can see there is an item checked (because that record has a value) and there is no way to uncheck it. Even if I click on the "checked" item, the combobox seems to cleared but once I click outside the combobox, the value appears still selected. 

    MicaBassi_0-1712926102061.png

     

    Hope this helps clarify the request.

     

    Thanks! 🙂

  • Ami K Profile Picture
    15,687 Super User 2024 Season 1 on at

    @MicaBassi - my knowledge of modern controls are almost non-existent. However, before I cc another super user into this post, are you sure that control has been set to allow multiple selections?

  • MicaBassi Profile Picture
    on at

    Hi @Amik, the control is not set to multiple selection as the field in sharepoint does not allow multiple selection. It is not expected for that field as we only need one user name to be selected in that column. To be able to clear the selection, does it have to be set to multiple selection?

     

    Thanks!

    Mica

  • Ami K Profile Picture
    15,687 Super User 2024 Season 1 on at

    @MicaBassi - sorry when you said "does not allow to unselect the options" I assumed the LookUp field was multi-select.

     

    What happens if you simply replace the Combobox control with the Classic ComboBox control?

  • MicaBassi Profile Picture
    on at

    No worries! Both the classic combobox and classic dropdown work just fine. But unfortunately we can't change it to the classic controls, since the entire app is built with modern controls and we need to keep the same look & feel throughout the app 🙁

     

    I thought about having a workaround, add a button within the datacard that clears any value selected when clicked, but not sure how to accomplish a functionality like that. 

  • Ami K Profile Picture
    15,687 Super User 2024 Season 1 on at

    @MicaBassi - I have performed a test in my environment using SharePoint as a datasource with a modern ComboBox control, and this is not a problem I can replicate.

     

    I hope you find a solution, but I would be mindful of deploying an app into production which uses controls that remain in preview. 

  • MicaBassi Profile Picture
    on at

    @WarrenBelz Hi Warren, I'm adding you here since I see you are Top Solutions author, perhaps you could have an idea to fix this issue? Thanks in advance 🙂

  • WarrenBelz Profile Picture
    155,240 Most Valuable Professional on at

    Hi @MicaBassi ,

    You will probably not like the answer here, but if something works fine on a Classic Control and the same function does not on the equivalent Modern Control, the issue is generally the inherent stability/consistency of the Modern Control. Apart from the current lack of some facilities/functions compared with Classic, they are still “work in progress” (although constantly improving) but I have not transitioned to any beyond my test environment.

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
Vish WR Profile Picture

Vish WR 914

#2
11manish Profile Picture

11manish 627

#3
Valantis Profile Picture

Valantis 598

Last 30 days Overall leaderboard