cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
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
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.

 

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

 

@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!

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. 

@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!

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 🙂

 

 

 

@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

@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
News & Announcements

Community Blog

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

Power Apps Community Call

Power Apps Community Call- January

Mark your calendars and join us for the next Power Apps Community Call on January 20th, 8a PST

PP Bootcamp Carousel

Global Power Platform Bootcamp

Dive into the Power Platform stack with hands-on sessions and labs, virtually delivered to you by experts and community leaders.

secondImage

Power Platform Community Conference On Demand

Watch Nick Doelman's session from the 2020 Power Platform Community Conference on demand!

Top Solution Authors
Top Kudoed Authors
Users online (7,680)