cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
schwibach
Super User
Super User

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?

 

 

__________________________________
Please mark topics as solved if they are and give kudos to make people happy 🙂
Always interested to hear about solutions/problems in the education sector.
1 ACCEPTED SOLUTION

Accepted Solutions
RandyHayes
Super User
Super User

@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 below. Solved your problem? - Click on Accept as Solution below. Others seeking the same answers will be happy you did.
NOTE: My normal response times will be Mon to Fri from 1 PM to 10 PM UTC (and lots of other times too!)
Check out my PowerApps Videos too! And, follow me on Twitter @RandyHayes

Really want to show your appreciation? Buy Me A Cup Of Coffee!

View solution in original post

14 REPLIES 14
RandyHayes
Super User
Super User

@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 below. Solved your problem? - Click on Accept as Solution below. Others seeking the same answers will be happy you did.
NOTE: My normal response times will be Mon to Fri from 1 PM to 10 PM UTC (and lots of other times too!)
Check out my PowerApps Videos too! And, follow me on Twitter @RandyHayes

Really want to show your appreciation? Buy Me A Cup Of Coffee!

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.

 

__________________________________
Please mark topics as solved if they are and give kudos to make people happy 🙂
Always interested to hear about solutions/problems in the education sector.
RandyHayes
Super User
Super User

@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 below. Solved your problem? - Click on Accept as Solution below. Others seeking the same answers will be happy you did.
NOTE: My normal response times will be Mon to Fri from 1 PM to 10 PM UTC (and lots of other times too!)
Check out my PowerApps Videos too! And, follow me on Twitter @RandyHayes

Really want to show your appreciation? Buy Me A Cup Of Coffee!

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.  

__________________________________
Please mark topics as solved if they are and give kudos to make people happy 🙂
Always interested to hear about solutions/problems in the education sector.
RandyHayes
Super User
Super User

@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 below. Solved your problem? - Click on Accept as Solution below. Others seeking the same answers will be happy you did.
NOTE: My normal response times will be Mon to Fri from 1 PM to 10 PM UTC (and lots of other times too!)
Check out my PowerApps Videos too! And, follow me on Twitter @RandyHayes

Really want to show your appreciation? Buy Me A Cup Of Coffee!
schwibach
Super User
Super User

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!

__________________________________
Please mark topics as solved if they are and give kudos to make people happy 🙂
Always interested to hear about solutions/problems in the education sector.
RandyHayes
Super User
Super User

@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 below. Solved your problem? - Click on Accept as Solution below. Others seeking the same answers will be happy you did.
NOTE: My normal response times will be Mon to Fri from 1 PM to 10 PM UTC (and lots of other times too!)
Check out my PowerApps Videos too! And, follow me on Twitter @RandyHayes

Really want to show your appreciation? Buy Me A Cup Of Coffee!

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?

__________________________________
Please mark topics as solved if they are and give kudos to make people happy 🙂
Always interested to hear about solutions/problems in the education sector.
schwibach
Super User
Super User

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

 

__________________________________
Please mark topics as solved if they are and give kudos to make people happy 🙂
Always interested to hear about solutions/problems in the education sector.

Helpful resources

Announcements

Exclusive LIVE Community Event: Power Apps Copilot Coffee Chat with Copilot Studio Product Team

  It's time for the SECOND Power Apps Copilot Coffee Chat featuring the Copilot Studio product team, which will be held LIVE on April 3, 2024 at 9:30 AM Pacific Daylight Time (PDT).     This is an incredible opportunity to connect with members of the Copilot Studio product team and ask them anything about Copilot Studio. We'll share our special guests with you shortly--but we want to encourage to mark your calendars now because you will not want to miss the conversation.   This live event will give you the unique opportunity to learn more about Copilot Studio plans, where we’ll focus, and get insight into upcoming features. We’re looking forward to hearing from the community, so bring your questions!   TO GET ACCESS TO THIS EXCLUSIVE AMA: Kudo this post to reserve your spot! Reserve your spot now by kudoing this post.  Reservations will be prioritized on when your kudo for the post comes through, so don't wait! Click that "kudo button" today.   Invitations will be sent on April 2nd.Users posting Kudos after April 2nd. at 9AM PDT may not receive an invitation but will be able to view the session online after conclusion of the event. Give your "kudo" today and mark your calendars for April 3rd, 2024 at 9:30 AM PDT and join us for an engaging and informative session!

Tuesday Tip: Unlocking Community Achievements and Earning Badges

TUESDAY TIPS are our way of communicating helpful things we've learned or shared that have helped members of the Community. Whether you're just getting started or you're a seasoned pro, Tuesday Tips will help you know where to go, what to look for, and navigate your way through the ever-growing--and ever-changing--world of the Power Platform Community! We cover basics about the Community, provide a few "insider tips" to make your experience even better, and share best practices gleaned from our most active community members and Super Users.   With so many new Community members joining us each week, we'll also review a few of our "best practices" so you know just "how" the Community works, so make sure to watch the News & Announcements each week for the latest and greatest Tuesday Tips!     THIS WEEK'S TIP: Unlocking Achievements and Earning BadgesAcross the Communities, you'll see badges on users profile that recognize and reward their engagement and contributions. These badges each signify a different achievement--and all of those achievements are available to any Community member! If you're a seasoned pro or just getting started, you too can earn badges for the great work you do. Check out some details on Community badges below--and find out more in the detailed link at the end of the article!       A Diverse Range of Badges to Collect The badges you can earn in the Community cover a wide array of activities, including: Kudos Received: Acknowledges the number of times a user’s post has been appreciated with a “Kudo.”Kudos Given: Highlights the user’s generosity in recognizing others’ contributions.Topics Created: Tracks the number of discussions initiated by a user.Solutions Provided: Celebrates the instances where a user’s response is marked as the correct solution.Reply: Counts the number of times a user has engaged with community discussions.Blog Contributor: Honors those who contribute valuable content and are invited to write for the community blog.       A Community Evolving Together Badges are not only a great way to recognize outstanding contributions of our amazing Community members--they are also a way to continue fostering a collaborative and supportive environment. As you continue to share your knowledge and assist each other these badges serve as a visual representation of your valuable contributions.   Find out more about badges in these Community Support pages in each Community: All About Community Badges - Power Apps CommunityAll About Community Badges - Power Automate CommunityAll About Community Badges - Copilot Studio CommunityAll About Community Badges - Power Pages Community

Tuesday Tips: Powering Up Your Community Profile

TUESDAY TIPS are our way of communicating helpful things we've learned or shared that have helped members of the Community. Whether you're just getting started or you're a seasoned pro, Tuesday Tips will help you know where to go, what to look for, and navigate your way through the ever-growing--and ever-changing--world of the Power Platform Community! We cover basics about the Community, provide a few "insider tips" to make your experience even better, and share best practices gleaned from our most active community members and Super Users.   With so many new Community members joining us each week, we'll also review a few of our "best practices" so you know just "how" the Community works, so make sure to watch the News & Announcements each week for the latest and greatest Tuesday Tips!   This Week's Tip: Power Up Your Profile!  🚀 It's where every Community member gets their start, and it's essential that you keep it updated! Your Community User Profile is how you're able to get messages, post solutions, ask questions--and as you rank up, it's where your badges will appear and how you'll be known when you start blogging in the Community Blog. Your Community User Profile is how the Community knows you--so it's essential that it works the way you need it to! From changing your username to updating contact information, this Knowledge Base Article is your best resource for powering up your profile.     Password Puzzles? No Problem! Find out how to sync your Azure AD password with your community account, ensuring a seamless sign-in. No separate passwords to remember! Job Jumps & Email Swaps Changed jobs? Got a new email? Fear not! You'll find out how to link your shiny new email to your existing community account, keeping your contributions and connections intact. Username Uncertainties Unraveled Picking the perfect username is crucial--and sometimes the original choice you signed up with doesn't fit as well as you may have thought. There's a quick way to request an update here--but remember, your username is your community identity, so choose wisely. "Need Admin Approval" Warning Window? If you see this error message while using the community, don't worry. A simple process will help you get where you need to go. If you still need assistance, find out how to contact your Community Support team. Whatever you're looking for, when it comes to your profile, the Community Account Support Knowledge Base article is your treasure trove of tips as you navigate the nuances of your Community Profile. It’s the ultimate resource for keeping your digital identity in tip-top shape while engaging with the Power Platform Community. So, dive in and power up your profile today!  💪🚀   Community Account Support | Power Apps Community Account Support | Power AutomateCommunity Account Support | Copilot Studio  Community Account Support | Power Pages

Super User of the Month | Chris Piasecki

In our 2nd installment of this new ongoing feature in the Community, we're thrilled to announce that Chris Piasecki is our Super User of the Month for March 2024. If you've been in the Community for a while, we're sure you've seen a comment or marked one of Chris' helpful tips as a solution--he's been a Super User for SEVEN consecutive seasons!       Since authoring his first reply in April 2020 to his most recent achievement organizing the Canadian Power Platform Summit this month, Chris has helped countless Community members with his insights and expertise. In addition to being a Super User, Chris is also a User Group leader, Microsoft MVP, and a featured speaker at the Microsoft Power Platform Conference. His contributions to the new SUIT program, along with his joyous personality and willingness to jump in and help so many members has made Chris a fixture in the Power Platform Community.   When Chris isn't authoring solutions or organizing events, he's actively leading Piasecki Consulting, specializing in solution architecture, integration, DevOps, and more--helping clients discover how to strategize and implement Microsoft's technology platforms. We are grateful for Chris' insightful help in the Community and look forward to even more amazing milestones as he continues to assist so many with his great tips, solutions--always with a smile and a great sense of humor.You can find Chris in the Community and on LinkedIn. Thanks for being such a SUPER user, Chris! 💪🌠

Find Out What Makes Super Users So Super

We know many of you visit the Power Platform Communities to ask questions and receive answers. But do you know that many of our best answers and solutions come from Community members who are super active, helping anyone who needs a little help getting unstuck with Business Applications products? We call these dedicated Community members Super Users because they are the real heroes in the Community, willing to jump in whenever they can to help! Maybe you've encountered them yourself and they've solved some of your biggest questions. Have you ever wondered, "Why?"We interviewed several of our Super Users to understand what drives them to help in the Community--and discover the difference it has made in their lives as well! Take a look in our gallery today: What Motivates a Super User? - Power Platform Community (microsoft.com)

March User Group Update: New Groups and Upcoming Events!

  Welcome to this month’s celebration of our Community User Groups and exciting User Group events. We’re thrilled to introduce some brand-new user groups that have recently joined our vibrant community. Plus, we’ve got a lineup of engaging events you won’t want to miss. Let’s jump right in: New User Groups   Sacramento Power Platform GroupANZ Power Platform COE User GroupPower Platform MongoliaPower Platform User Group OmanPower Platform User Group Delta StateMid Michigan Power Platform Upcoming Events  DUG4MFG - Quarterly Meetup - Microsoft Demand PlanningDate: 19 Mar 2024 | 10:30 AM to 12:30 PM Central America Standard TimeDescription: Dive into the world of manufacturing with a focus on Demand Planning. Learn from industry experts and share your insights. Dynamics User Group HoustonDate: 07 Mar 2024 | 11:00 AM to 01:00 PM Central America Standard TimeDescription: Houston, get ready for an immersive session on Dynamics 365 and the Power Platform. Connect with fellow professionals and expand your knowledge. Reading Dynamics 365 & Power Platform User Group (Q1)Date: 05 Mar 2024 | 06:00 PM to 09:00 PM GMT Standard TimeDescription: Join our virtual meetup for insightful discussions, demos, and community updates. Let’s kick off Q1 with a bang! Leaders, Create Your Events!    Leaders of existing User Groups, don’t forget to create your events within the Community platform. By doing so, you’ll enable us to share them in future posts and newsletters. Let’s spread the word and make these gatherings even more impactful! Stay tuned for more updates, inspiring stories, and collaborative opportunities from and for our Community User Groups.   P.S. Have an event or success story to share? Reach out to us – we’d love to feature you!

Top Solution Authors
Top Kudoed Authors
Users online (4,845)