cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Helper I
Helper I

DataTables showing old data on New Form

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? 

1 ACCEPTED SOLUTION

Accepted Solutions

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!

View solution in original post

9 REPLIES 9
Highlighted
Advocate II
Advocate II

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.

 

Highlighted

I get, "The function expects a resetable control as it's input"

 

Highlighted

@simkessy 

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?

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up. Solved your problem? - Click on Accept as Solution. Others seeking the same answers will be happy you did.
Check out my PowerApps Videos too!
Highlighted

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. 

Highlighted

@simkessy 

One other question after looking at your response...

Is ChildList the name of your datasource or is it a collection?

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up. Solved your problem? - Click on Accept as Solution. Others seeking the same answers will be happy you did.
Check out my PowerApps Videos too!
Highlighted

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 🙂

 

 

 

Highlighted

@simkessy 

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.

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up. Solved your problem? - Click on Accept as Solution. Others seeking the same answers will be happy you did.
Check out my PowerApps Videos too!

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!

View solution in original post

Highlighted

@simkessy 

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.

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up. Solved your problem? - Click on Accept as Solution. Others seeking the same answers will be happy you did.
Check out my PowerApps Videos too!

Helpful resources

Announcements
Community Conference

Power Platform Community Conference

Check out the on demand sessions that are available now!

News & Announcements

Community Blog

Stay up tp date on the latest blogs and activities in the community News & Announcements.

secondImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Top Solution Authors
Top Kudoed Authors
Users online (13,014)