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
Highlighted
Helper I
Helper I

Re: DataTables showing old data on New Form

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

Re: DataTables showing old data on New Form

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
Helper I
Helper I

Re: DataTables showing old data on New Form

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

 

Highlighted
Super User
Super User

Re: DataTables showing old data on New Form

@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.
Highlighted
Helper I
Helper I

Re: DataTables showing old data on New Form

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
Super User
Super User

Re: DataTables showing old data on New 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.
Highlighted
Helper I
Helper I

Re: DataTables showing old data on New Form

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
Super User
Super User

Re: DataTables showing old data on New Form

@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.
Highlighted
Helper I
Helper I

Re: DataTables showing old data on New Form

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
Super User
Super User

Re: DataTables showing old data on New Form

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

Helpful resources

Announcements
secondImage

Demo-Extravaganza 2020

Check out these cool Power Apps & vote on your favorite!

secondImage

Robotic Process Automation

Let's talk about the solution provided by Microsoft for Robotic Process Automation (RPA)

secondImage

Community Highlights

Check out whats happening in Power Apps

secondImage

Community User Group Member Badges

FIll out a quick form to claim your community user group member badge today!

Top Solution Authors
Top Kudoed Authors
Users online (9,653)