cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
ywliang96
Helper II
Helper II

Error submitting a form

I created a custom entity with custom field before creating an app. I chose “creating an app with data” and chose the entity I just created.

The PowerApp instantly built a form for me automatically but the problem happens when I tried to add a new form and it will pop up an error like “.... the data source is invalid” and the coding for “SubmitForm(Form1) will have an “X” red colour icon when the coding is clearly correct.

Anybody know how to settle this? Been stuck for hours
9 REPLIES 9
cds
Impactful Individual
Impactful Individual

Screenshot the error and your formula please!

rebeccas
Community Champion
Community Champion

Is your form set to FormMode.New?

Here's the error I got when i tried to submit a form

 p1.PNG

 

While the button suddenly have this error 

p2.PNG

 

I tried clicking on the formula area and this error leads me to this part. I'm sure it's correct isn't it?

p3.PNG

I use SubmitForm(Form1)

cds
Impactful Individual
Impactful Individual

Screenshot your error and formula to achice solution

Hi @ywliang96 

I would try refreshing your data source to see if that helps.

You can do this through the View > Datasources menu item. Against your CDS data source, you'll find a 'Refresh' menu item when you click the '...' button.

v-xida-msft
Community Support
Community Support

Hi @ywliang96 ,

Have you taken a try to submit your form data using Patch function?

 

Based on the issue that you mentioned, I have made a test on my side, and don't have the issue that you mentioned. Please consider create a Blank app, and then add your CDS Entity as data source within it, then add your New Edit form, check if the issue is solved.

 

Also please consider clear cache of your browser, then sign in your PowerApps again, then re-generate an app from your Entity, check if the issue still exists.

 

Please also consider submit your Form data using Patch function instead of SubmitForm function, the standard Patch formula as below:

Patch(
          'Your Entity',
           Defaults('Your Entity'),
           EditForm1.Updates
)

or

Patch(
          'Your Entity',
           Defaults('Your Entity'),
           {
Column1: DataCardValue1.Text,
Column2: DataCardValue2.Text,
...
} )

 

Best regards,

Community Support Team _ Kris Dai
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
rebeccas
Community Champion
Community Champion

Did you ever say if it has a FormMode of New or Edit? I've only ever seen this when it is an Edit form. 

ericonline
Community Champion
Community Champion

Thanks for the heads up @timl .

I'm having this exact same experience right now except with a Canvas App submitting a Form:

https://powerusers.microsoft.com/t5/Building-PowerApps-Formerly/Data-Source-May-Be-Invalid/m-p/38409...

- Worked fine yesterday

- Added a Person-type field in the Sharepoint list

- The other Person-type fields (2 others) in the Form started acting up after this

- Refreshed/Removed/re-added Data Source

- Tried on both VPN and WiFi

- Tried on both laptop browser and iPhone

- Tried in both Editor and Player

 

- Another symptom and the reason I added another Person-type column to the Data Source:

  - Searching for People in Comboboxes backed by Sharepoint Person-type columns is hit or miss

  - Sometimes they work: When I type a name, results pop up

  - Sometimes they don't work: When I type a name, nothing happens


Issue persists. Please advise on some ideas for tackling this. 

Thank you

 

Helpful resources

Announcements
UG GA Amplification 768x460.png

Launching new user group features

Learn how to create your own user groups today!

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

M365 768x460.jpg

Microsoft 365 Collaboration Conference | December 7–9, 2021

Join us, in-person, December 7–9 in Las Vegas, for the largest gathering of the Microsoft community in the world.

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