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?
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
In this first screen (CollectEdit), the user enters the information
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)
The default properties of the edit screen (CollectEdit2) for each field is set to CollectGallery, e.g. CollectGallery.Selected.Customer
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"]
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:
2. This Is the Items property of my two dropdowns(both their Default property are blank):
3. This is the second screen:
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