I have a SharePoint form and a DataTables control outside the form.
DataTables.items = ComboBox.SelectedItems
When I submit the form:
Patch() > Reset(SharePointForm) > RequestHide()
Then when I create a New Form, the DataTables shows the values that were selected before even though the current ComboBox.SelectedItems is empty.
How do I reset DataTables?
Solved! Go to Solution.
Hey @RandyHayes ,
I did two things and I'm not entirely sure which solved it. I removed the ResetForm() function but I also tied the DataTables to a collection that's created on the "onChange" event of the ComboBox.
Essentially when the ComboBox is changed I'm using:
ClearCollect(MySelectedItems, ComboBox.SelectedItems)
Then: "DataTables.Items = MySelectedItems"
This seems to be working pretty well for me now. Thanks your help!
Does resetting the data table work in your submit function at the end of your submit function work? Reset(DataTable).
You can try to reset the combobox too.
I get, "The function expects a resetable control as it's input"
Yes, the DataTable does not have a Reset capabilty.
So, let me get it straight though...your DataTable is only showing the seleted values from your ComboBox?
Maybe as well...what is the Items property for the ComboBox?
And...pretty sure I read through the lines on this - we are dealing with SharePointIntegration - yes?
Hey,
So, let me get it straight though...your DataTable is only showing the seleted values from your ComboBox? Maybe as well...what is the Items property for the ComboBox?
My ComboBox.Ttems =
AddColumns(ChildList, "Subtext", EmailAddress & " | Active: " & ActiveContract.Value & " | Age: " & age, "ActiveStatusText", ActiveContract.Value)
And DataTables.Items = "ChildSelector.SelectedItems" which is a combo field on the Form.
And...pretty sure I read through the lines on this - we are dealing with SharePointIntegration - yes?
Yea, I'm customizing the default form.
One other question after looking at your response...
Is ChildList the name of your datasource or is it a collection?
Hey @RandyHayes
ChildList is the name of the secondary list that ParentList looks up using the childItem column
So I have two lists:
ParentList:
- Title: Text Field
- ChildItem: Multi-Lookup --> ChildList
ChildList:
- Title and a few other fields
The form I'm editing is on ParentList and I'm trying to update and edit Title and ChildItem from ParentList only
DataTable is tied to the ChildItem (SelectedItems) column
Hopefully that clears things up 🙂
Yes, that helps, thanks. Just wanted to make sure we were dealing with datasources and not collections.
So, at a test, take out the ResetForm function that you are using. See if you see different (and hopefully more accurate) results.
Let me know what you see from that.
Hey @RandyHayes ,
I did two things and I'm not entirely sure which solved it. I removed the ResetForm() function but I also tied the DataTables to a collection that's created on the "onChange" event of the ComboBox.
Essentially when the ComboBox is changed I'm using:
ClearCollect(MySelectedItems, ComboBox.SelectedItems)
Then: "DataTables.Items = MySelectedItems"
This seems to be working pretty well for me now. Thanks your help!
Glad that helped you out. Not sure if it is related or not, but found some similar issue with this refresh problem in this post. You might want to take a look at that, specifically the most recent post where I added the Refresh function to the form. Perhaps give that a shot. I didn't have much time to review the issue yesterday and removing the ResetForm seemed to help, but after having a little more time today, seems that was just a quick-fix with more problems to come. I have a tendency to think there is an issue with the Integration at the moment, but not sure if it has always been this way or not.
Stay up tp date on the latest blogs and activities in the community News & Announcements.
Mark your calendars and join us for the next Power Apps Community Call on January 20th, 8a PST
Dive into the Power Platform stack with hands-on sessions and labs, virtually delivered to you by experts and community leaders.
User | Count |
---|---|
198 | |
172 | |
60 | |
32 | |
32 |
User | Count |
---|---|
336 | |
271 | |
104 | |
71 | |
56 |