Skip to main content

Notifications

Power Apps - Building Power Apps
Unanswered

Dropdown fields in collection not resetting

(0) ShareShare
ReportReport
Posted on by 395

I have an app that writes to a collection. On the first screen, the user enters the data in the textinputs, then clicks an "add record" button (OnSelect of the add record button) Collect(KBLCollection, {Date:DatePicker2.SelectedDate, Customer:Customer_ED.Selected.Value,Title:Employee_ED.Selected.Value});Reset(DatePicker2),Reset(Employee_ED),Reset(Customer_ED);SaveData(KBLCollection, "KBLCollectKeep")

I have another screen (CollectEdit2) with a gallery linked to the collection and the textInputs are set to CollectGallery.Selected.Title. I also have a update record button with the onslect set to Patch(KBLCollection,CollectGallery.Selected,{Date:Date_2.SelectedDate,Customer:Customer_2.Selected.Value,Title:Employee_2.Selected.Value}); Reset(Date_2),Reset(Customer_2),Reset(Employee_2)

The problem I'am having now, when a user adds information to the collection, and doesn't input any information in the dropdowns it automatically brings data across from previous entry. It only applies to the dropdown fields. Can you please assist? 

Categories:
  • v-albai-msft Profile Picture
    v-albai-msft on at
    Re: Dropdown fields in collection not resetting

    Hi @Matt383 ,

    How are things going? Have you solved your issue?

    Best regards,

    Allen

  • v-albai-msft Profile Picture
    v-albai-msft on at
    Re: Dropdown fields in collection not resetting

    Hi @Matt383 ,

    Two ways you can try:

    1. Set the dropdown's Default to "Parent.Default" instead of using CollectGallery.Selected.Customer. This is to append any existing data (if any) or blank if none.

    2. If above still not work, try this formula(replace to your form name):

    If(CollectEditForm.Mode=FormMode.New,Blank(),CollectEditForm.Mode=FormMode.Edit,CollectGallery.Selected.Customer)

    Best regards,

    Allen

  • Matt383 Profile Picture
    Matt383 395 on at
    Re: Dropdown fields in collection not resetting

    In this first screen (CollectEdit), the user enters the information 

    Matt383_0-1616537630491.png

    Then when the select add record, it saves to a collection, resets the TextInputs, dropdowns (using Reset(Customer_ED);Reset(DatePicker2); etc, and navigates to another screen with a gallery with the data source set to the collection. Giving the user the option to edit the entry. User then can select the arrow in the gallery and navigate to CollectEdit2 screen where the user can edit the entry if required. (See below)

    Matt383_1-1616538081775.png

    The default properties of the edit screen (CollectEdit2) for each field is set to CollectGallery, e.g. CollectGallery.Selected.Customer

    Matt383_2-1616538234395.png

     

    all the fields reset when i go to add a new entry (in CollectEdit), The problem occurs when a user puts multiple entries in. eg. goes to CollectEdit, populates all dropdown fields, adds the record to the collection, then  goes back to add a new entry but doesnt populate any of the dropdown fileds. When this occurs, the information in the previous entry dropdowns carries accross to the 2nd entry In CollectEdit2.

     

    The defauts for dropdowns in CollectEdit are set to "1" and the Items property vary for each, basically ["Option1","Option2"] 

     

     

     

  • v-albai-msft Profile Picture
    v-albai-msft on at
    Re: Dropdown fields in collection not resetting

    Hi @Matt383 ,

    What do you mean about “it automatically brings data across from previous entry”?

    What is the Items property and Default property of the issued dropdown?

    Also, you should use “;” instead of using “,” between Reset() function, check if this is related to your issue.

    Besides, you can add a label and set its Text to “dropdown.Select.Value” to compare the value before/after clicking the button for helping your narrow down your issue.

    Based on your description, I did a test on my side, but did not reproduce your issue, you can check my steps:

    1. This is my first screen:

    v-albai-msft_0-1616490529781.png

    2. This Is the Items property of my two dropdowns(both their Default property are blank):

    v-albai-msft_1-1616490529784.png

    v-albai-msft_2-1616490529787.png

    3. This is the second screen:

    v-albai-msft_3-1616490529792.png

    Everything works fine when I click a record in the gallery and then edit its value through “update record” button. And all dropdowns revert to their default values(the first value).

    Best Regards,

    Allen

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

Microsoft Kickstarter Events…

Register for Microsoft Kickstarter Events…

Announcing Our 2025 Season 1 Super Users!

A new season of Super Users has arrived, and we are so grateful for the daily…

Announcing Forum Attachment Improvements!

We're excited to announce that attachments for replies in forums and improved…

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 145,445

#2
RandyHayes Profile Picture

RandyHayes 76,287

#3
Pstork1 Profile Picture

Pstork1 64,741

Leaderboard