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

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

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

13 REPLIES 13
Meneghino
Community Champion
Community Champion

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

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})

Does the Errors() function give you any insight?

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

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

 

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)

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

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

agneum
Advocate IV
Advocate IV

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
2022 Release Wave 1 760x460.png

2022 Release Wave 1 Plan

Power Platform release plan for the 2022 release wave 1 describes all new features releasing from April 2022 through September 2022.

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

Top Solution Authors
Top Kudoed Authors
Users online (2,022)