cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
UncountedBrute
Level: Powered On

There was a problem saving your changes. The data source may be invalid.

I have been trying to resolve this issue for days now and still no luck.

 

I am trying to update a contact item in the contact entity within CRM.

The user selects the contact from a Display Gallery which i then use Gallery1.Selected as the Item in the Edit Form.

 

The user can then modify the email address of the contact and when pressing next, this should go off and update the record with the new email.

 

Issue is, when i click the next button, it comes up with the error shown in the subject ^. I have tried recreating the Contact Data connection in PowerApps.

 

I have run out of other ideas to try and any help would be great.

 

Thanks in advance

1 ACCEPTED SOLUTION

Accepted Solutions
Meneghino
Level 10

Re: There was a problem saving your changes. The data source may be invalid.

OK, if the problem then might be with the forms then you might try to create your own.

Here is a basic post I wrote that may give you some ideas:

http://baizini-it.com/blog/index.php/2017/09/28/powerapps-101-create-your-own-forms/

View solution in original post

12 REPLIES 12
Meneghino
Level 10

Re: There was a problem saving your changes. The data source may be invalid.

I would try to patch a change to a record to distinguish from issues from data issues.

 

You can create a button with OnSelect:

Patch(YourTable, Gallery1.Selected, {EmailField: "random@text.com"})

Also, I would check the data type of the email field and whether there are any constraints.  Ideally it would be a text (i.e. nvarchar()) type with no constraints.

 

PS I always abandon PowerApps forms and prefer to roll my own

UncountedBrute
Level: Powered On

Re: There was a problem saving your changes. The data source may be invalid.

Thanks for your help.

 

However the Patch doesn't seem to be working either. The emailaddress1 field is a single line of text within CRM (which PowerApps recognises)

 

The Patch i used is as follows:

Patch(Contacts, DG_StuList.Selected, {emailaddress1: TB_StuEmailAddress_1})
Meneghino
Level 10

Re: There was a problem saving your changes. The data source may be invalid.

Does the Errors() function give you any insight?

UncountedBrute
Level: Powered On

Re: There was a problem saving your changes. The data source may be invalid.

How would i use the Error() function in my scenario? I have had a look and can't seem to get it working.

Meneghino
Level 10

Re: There was a problem saving your changes. The data source may be invalid.

It is not Error() but Errors():

https://powerapps.microsoft.com/en-us/tutorials/function-errors/

 

Create a gallery and set Errors(Contacts) as the Items property.

Then add labels to the gallery template to show you what information is there.

Alternatively do this:

Patch(Contacts, DG_StuList.Selected, {emailaddress1: TB_StuEmailAddress_1}); ClearCollect(MyErrors, Errors(Contacts))

And then look into the collection in PowerApps Studio

 

UncountedBrute
Level: Powered On

Re: There was a problem saving your changes. The data source may be invalid.

I tried the ClearCollect method and it didn't yield anything.

 

I even tried on the other connections i have in my app but still nothing.

 

Strange enough, when i disable all other submissions other than the Patch(). It works fine (sort of)

Meneghino
Level 10

Re: There was a problem saving your changes. The data source may be invalid.

OK, if the problem then might be with the forms then you might try to create your own.

Here is a basic post I wrote that may give you some ideas:

http://baizini-it.com/blog/index.php/2017/09/28/powerapps-101-create-your-own-forms/

View solution in original post

UncountedBrute
Level: Powered On

Re: There was a problem saving your changes. The data source may be invalid.

Thanks, Patch worked in the end! I will start going through modifying my implementations with this function cause it performs a lot better.

agneum
Level 8

Re: There was a problem saving your changes. The data source may be invalid.

Could be caused by a trigger on the table for the update. Those are not allowed by the way the SQL-connector done, apparently.

 

Helpful resources

Announcements
thirdimage

Power Automate Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

sixthImage

Power Platform World Tour

Find out where you can attend!

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

fifthimage

Microsoft Learn

Learn how to build the business apps that you need.

Top Kudoed Authors (Last 30 Days)
Users online (5,208)