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

Error repeat sending a form: data source may be invalid

I managed (with great help from @RandyHayes ... thanks again!)

To create an app that submits a form as a new entry to a Sharepoint list.

It does that fine.

But when I go back from the success screen and try to submit the form another time, it doesn't work.

It shows me an error about the data source being invalid.

What could that be?

 

The button that navigates me back from the success screen to the general one should also refresh the variables with data from the SP list.

Should I try and do something like clear all data and have "On Start" run again, or should I just reset the variables?

 

 

1 ACCEPTED SOLUTION

Accepted Solutions
Super User III
Super User III

@schwibach 

Actually nothing in the datacard is of any impact to the Update of the record unless the Update property references it.  In other words, the ONLY thing that is important to SubmitForm is the Update properties of the DataCards.  Default is fairly irrelevant to your situation if you have no defaults in your datasource and you are only creating new records with the form.

 

So, here are a couple things to first try...save your app and exit the designer.  Then go back in to edit and try again.  Sometimes the datasource gets an error and it will not go away until you do that.

Also, as almost a last resort, remove your datasource and add it back in.

 

Make sure you can actually enter a pretty empty record in the ShrePoint list itself (add a new record and enter only in the field that you are using in your new form), and that doing so does not produce an error.

 

Return to your app and place a quoted text formula in one of the Update properties of a Datacard and try the submit again.  

 

Let's see if any of those stones turn up a snake.

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

View solution in original post

14 REPLIES 14
Super User III
Super User III

@schwibach 
Skip the variables as much as possible - they are static snapshots. 

If you are submitting the form (via SubmitForm), then the underlying Item of the form and the datasource will have changed.  Now, that said, this does depend on the Item property of your form.  If your Item property IS a variable - let's say varRecord, then in the OnSuccess of your Form, place the following formula: Set(varRecord, yourFormName.LastSubmit)

 

I hope this is helpful for you.

 

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

Ok, so I'll take out the variables and put the formulas directly into the fields the values go into.

 

The reason why I'm asking is:
I want people to be able to see what's actually in the SharePoint list, and not take the data that they just entered into the app.

So, the fields should update on click of the button from the success screen to the initial screen.

 

Super User III
Super User III

@schwibach 

If you are using an EditForm, the LastSubmit property of that form will have the updated entire record.  You can assign this to a variable if needed.  Otherwise, when you Submit a form, the underlying datasource will be updated as well.

There is not need to set variables to capture that information.

 

The only question I have is with your statement "I want people to be able to see what's actually in the SharePoint list, and not take the data that they just entered into the app"

Does this mean that you expect the SharePoint list to change from some other means, and you want to get the changes in that list to show to the user?  If so, then you have to refresh the datasource.

If you are stating the the submit that was just done should be what shows for that record, then that is already done in your app.  You don't need to account for it. AND, you do NOT need to refresh the datasource to get what has been submitted.

 

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

We're always writing new lines in the SP-list. 

There are teachers submitting info via
MS Forms => Powerautomate
and headmasters submitting with the Powerapp.

The headmasters should be able to both submit data and check what and when the teachers of their school submitted data.

 

It all comes together in the SP-list and I'll auto-update an excel table from that, which the headoffice is overseeing.

 

Checking the Sharepoint list was just meant to make extra sure that the form was submitted.
Having said that, I do in any case want them to be able to go back and have the current values in the text fields that draw from the Sharepoint List...
So, somehow I'd have to tell the app to update the data source.  

Super User III
Super User III

@schwibach 

Yep, so for clarity.  I am not referring to others updating other items in the list.  That will be design specific.

 

If there is a chance that someone else is updating the exact same item in the list, then there are some additional steps that you need to take.  One is that you will need to utilize the OnFailure of the form to catch the error.  Then you will need to determine if the error is due to a record conflict.  If there is, then you can actually revert JUST that record from the datasource and then attempt to resubmit.

 

If there is a chance that someone will be updating other records other than the one that is being edited, then if the user needs to eventually access that record, then you'll want to refresh the datasource.

 

NOW...keep in mind, all of what I talk about above is in the context of an individual session. If the user exits the app and comes back in, the data will be as current as the point at which they start the app again.  So, you need not concern yourself with data changing  by other sources and the user not being in the app - it will be up-to-date when they return again.

 

As for the moment in time that a user submits a form successfully and then returns immediately back to that record to edit in the form, there is no need for a refresh.

Taking from the first point above, if the user tries to submit the form and someone else has changed it, it will fail and that is where catching it in the OnFailure will be your recourse.  You can get the Error information at that point, and if need be, you can Revert that record and submit again.  The links in that sentence will take you to the docs that have more details.  In fact, in the Revert link, there is a pretty good example of how to catch the error and revert.  Although in that example they use a Patch, the concept would be the same with the Form, except you would use the current form record, then update your variable that you are using in the Item property of the form Patched with the Updates of the Form trying to be submitted - this will Revert to the new record values, then patch with the values that were entered.

 

I hope I am hitting the nail on the head for you and not off on some different tangent. 

 

 

_____________________________________________________________________________________
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!
Resolver I
Resolver I

That's all very interesting, really.

In this project we're only ever going to create new list items. So, in that specific case it shouldn't be the issue.

 

Right now I'm struggling with the form not submitting at all.

I wonder if it has to do with having the formulas in the update field.

 

I can check that it actually fails (by setting a text field to ohoh on failure) but I don't see why it fails.

 

I have a warning because of lookup function, but I doubt it's related.

 

Again, thank you so much!

Super User III
Super User III

@schwibach 

Yes, If you are just concerned over creating new items, then I would not bother much with all the rest, but you did say that once the user submits the form, you were trying to show them the values in some way?  I assumed this was being done in that same edit form.

 

In general, your Update properties of the form will reference some control or formula (or they can be static values).

I would go through the Update properties and make sure they are providing accurate values for your list.

Usually the error you are seeing is going to come from some update property that is providing either the wrong data or something in the wrong format (this happens often with dates).

 

To troubleshoot, I would first bring up the monitor tool and see what exactly is being passed to the datasource.  That might give a good clue as to where the problem is.  It will also show you the response from the cloud service that might give you more details on the problem.

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

Thanks again.

I went ahead and created a new form in that app (deleted the old one - which had worked before)

 

And I deleted all the fields from the form, only left one of them, deleted everything under the data card, set the mode to new and entered a string with "" in the update and/or the default field (tried all three versions) and I also referenced a formula.
In all cases submitting the form failed.
There are no columns (including the title) in the SP list that are required and I made sure we're trying to write into a text column.

 

The monitor only shows that a Select process succeeded. 

Any ideas?

Resolver I
Resolver I

One thing that might help... For some reason, submitting the form works on the phone, not on the computer

 

Helpful resources

Announcements
New Badges

New Solution Badges!

Check out our new profile badges recognizing authored solutions!

New Power Super Users

Congratulations!

We are excited to announce the Power Apps Super Users!

Power Apps Community Call

Power Apps Community Call: February

Did you miss the call? Check out the Power Apps Community Call here.

Microsoft Ignite

Microsoft Ignite

Join digitally, March 2–4, 2021 to explore new tech that's ready to implement. Experience the keynote in mixed reality through AltspaceVR!

Top Solution Authors
Top Kudoed Authors
Users online (16,448)