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

Not required field show field required when save

IMG_3708.PNG

Dear all,

I would like to use data card in PowerApps to save data on my premise SQL Server.

In the picture left hand side, this app created when SQL server table status field is allow null.

In the picture right hand side, this app create when SQL server table status field is not allow null.

My problem is can I create app on SQL server with table status field in not allow null and not prompt error like the picture right hand side (I also set STATUS data card property required = false).

Thank you for your help and reply.

Regards,

Tommy

1 ACCEPTED SOLUTION

Accepted Solutions
Community Support Team
Community Support Team

Re: Not required field show field required when save

Hi @lmktommy ,

Could you please share a bit more about your scenario?

Do you want to not show up the error message ("Field Required") within the Edit form when you do not type a value within the STATUS field which is not allow null?

 

If you want to not show up the error message ("Field Required") within the Edit form when you do not type a value within the STATUS field which is not allow null, I afraid that there is no way to achieve your needs in PowerApps currently.

Actually, the error message (related to fields) displayed within your Edit form is based on your SQL Table data source itself rather than PowerApps. The Edit form inherits permissions/settings from the SQL Table.

If you set Not Null property for the STATUS field in your SQL Table, when you submit a new record using canvas app, within the Edit form, you must provide a valid value for the STATUS filed. If you do not provide a valid value for the STATUS field, you could not submit the form data to your SQL Table.

 

As an alternative solution, you could consider set a Default value for the STATUS field within your Edit form. Within your Edit form, unlock the STATUS Data card, set the Default property of the Text Input box within the STATUS data card to following:

If(EditForm1.Mode = FormMode.New, "Type a default value here", Parent.Default)

 

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.
4 REPLIES 4
Super User
Super User

Re: Not required field show field required when save

@lmktommy 

Can you explain a little more about what you are trying to do?

Your example shows a form where a column is set to not be required (allow Null) and the right example showed the proper response on a Form where a column is required (not allow Null).

If you have the SQL table field set to not allow null, then you will need to supply a value.

Are you trying to supply a value without the user entering one?  Or are you expecting the user to enter one, but want to change what is displayed?

_____________________________________________________________________________________
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.
Community Support Team
Community Support Team

Re: Not required field show field required when save

Hi @lmktommy ,

Could you please share a bit more about your scenario?

Do you want to not show up the error message ("Field Required") within the Edit form when you do not type a value within the STATUS field which is not allow null?

 

If you want to not show up the error message ("Field Required") within the Edit form when you do not type a value within the STATUS field which is not allow null, I afraid that there is no way to achieve your needs in PowerApps currently.

Actually, the error message (related to fields) displayed within your Edit form is based on your SQL Table data source itself rather than PowerApps. The Edit form inherits permissions/settings from the SQL Table.

If you set Not Null property for the STATUS field in your SQL Table, when you submit a new record using canvas app, within the Edit form, you must provide a valid value for the STATUS filed. If you do not provide a valid value for the STATUS field, you could not submit the form data to your SQL Table.

 

As an alternative solution, you could consider set a Default value for the STATUS field within your Edit form. Within your Edit form, unlock the STATUS Data card, set the Default property of the Text Input box within the STATUS data card to following:

If(EditForm1.Mode = FormMode.New, "Type a default value here", Parent.Default)

 

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.
lmktommy
Level: Powered On

Re: Not required field show field required when save

Dear Kris,
“Do you want to not show up the error message ("Field Required") within the Edit form when you do not type a value within the STATUS field which is not allow null?” Yes, you are correct.

Therefore, I set data table allow null and with default value. Thank you very much.
lmktommy
Level: Powered On

Re: Not required field show field required when save

Thank you for your reply. Actually, I would like to make a test that can I save property when data field is Not allow null and UI do not punch data on this field (because I have default value for this field). Thank you