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

SubmitForm gives error: 'Value must be provided' using CDS while not required

Hi,

 

I want to update a form by removing a field which is not required, but I get the error 'The requested operation is not valid. Server reponse: a value must be provided for item.'

 

How is this possible? You can find the settings in the pictures attached.

Would very nice if someone can help me.

 

KrValue must be provided_error.PNGDataCard properties current client.PNGDatacardValue properties current client.PNG

 

 

1 ACCEPTED SOLUTION

Accepted Solutions
ThomasVDS
Level: Powered On

Re: SubmitForm gives error: 'Value must be provided' using CDS while not required

@v-xida-msftI have found the solution in the last reply in the tread you added.

 

I enabled "Formula level error management" in the advanced settings of my app.

https://powerapps.microsoft.com/en-us/blog/new-feature-error-handling-and-writing-null-values-to-dat...

 

4 REPLIES 4
Community Support Team
Community Support Team

Re: SubmitForm gives error: 'Value must be provided' using CDS while not required

Hi @ThomasVDS ,

Could you please share a bit more about your issue?

How do you remove the "Not required" filed from your Edit form? Directly from Edit form or disable the corresponding Data card within the Fields panel?

 

Based on the issue that you mentioned, I have made a test on my side, and don't have the issue that you mentioned. If you want to remove a filed from your Edit form, please make sure thay you remove the Field from the Fields panel as below:4.JPG

rather than remove the field from your Edit form directly.

 

In addition, please consider use Patch function to submit your form data instead of SubmitForm function. The standard formula of Patch function as below:

If(
    EditForm1.Mode = FormMode.New,     /* <-- EditForm1 represents the Edit form in your app */
    Patch(
              'YourEntity',
               Defaults('YourEntity'),
               {
                 Active: ActiveComboBox.Selected.Value,
                 'Career Track': CareerTrackComboBox.Selected.Value,
                  ...
               }
    ),
    Patch(
              'YourEntity',
               BrowseGallery1.Selected,
               {
                 Active: ActiveComboBox.Selected.Value,
                 'Career Track': CareerTrackComboBox.Selected.Value,
                  ...
               }
    )
)

More details about Patch fucntion, please check the following article:

Patch function

 

Also please consider re-create a new app based on your CDS Entity, try above solutions I priovided, check if the issue is fixed.

 

Please take a try with above solution, check if the issue is solved.

 

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

Re: SubmitForm gives error: 'Value must be provided' using CDS while not required

@v-xida-msft 

Thank you for your response.

 

I need to correct myself. I don't want to remove field. I just want to empty the field (remove the value).

The 'current client' field is not mandatory.

I don't get any error when this field is empty and update another field -> it works

But when the field contains a value and I want to remove the value -> error

 

I will give the Patch funtion a try. :-)

 

Kr

Community Support Team
Community Support Team

Re: SubmitForm gives error: 'Value must be provided' using CDS while not required

Hi @ThomasVDS ,

Could you please share a bit more about the "Current Client" column in your CDS Entity? Is it a LookUp column or a Option Set Type column?

Have you taken a try with the Patch function I provided above?

Further, do you want to clear value within the "Current Client" field in your Edit form?

 

Actually, it is an known issue with Edit form in PowerApps. Within Edit form, we could not clear value within a LookUp field, Choice field, ... which has already been filled with values.

Please check and see if the following thread would help in your scenario:

https://powerusers.microsoft.com/t5/General-Discussion/Clear-DateField-and-Lookup-Column-value/m-p/1...

 

If the "Current Client" column is a Option Set type column in your CDS Entity, please consider use the following Patch function to clear the "Current Client" column value:

 

Patch(
         'YourCDSEntity',
          BrowseGallery1.Selected,
          {
            'Current Client': {
                                  Value: Blank()
                              }
          }
)

Or

 

 

Patch(
         'YourCDSEntity',
          BrowseGallery1.Selected,
          {
            'Current Client': {
                                  Id: -1,
                                  Value: Blank()
                              }
          }
)

 

 

If the "Current Client" column is a LookUp type column in your CDS Entity, please modify above formula as below:

Patch(
         'YourCDSEntity',
          BrowseGallery1.Selected,
          {
            'Current Client': LookUp(Consultants, Consultants = GUID(""))                /* <-- set a blank record to the 'Current Client' field */
          }
)

Note: The Consultants represents the Unique Identifier in your Consultants Entity.

 

Please take a try with above solution, check if the issue is solved.

 

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

Re: SubmitForm gives error: 'Value must be provided' using CDS while not required

@v-xida-msftI have found the solution in the last reply in the tread you added.

 

I enabled "Formula level error management" in the advanced settings of my app.

https://powerapps.microsoft.com/en-us/blog/new-feature-error-handling-and-writing-null-values-to-dat...

 

Helpful resources

Announcements
firstImage

Watch Sessions On Demand!

Continue your learning in our online communities.

Top Community Contributors for July 2019

Top Community Contributors for July 2019

Let's thank our top community contributors

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

FirstImage

Power Platform World Tour

Coming to a city near you

thirdimage

PowerApps Community User Group Member Badge

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

FourthImage

Join PowerApps User Group!!

Connect, share, and learn with your peers year-round

FifthImage

Dynamics 365 and Power Platform April 2019 Release notes

Features releasing from April 2019 through September 2019!

Users Online
Currently online: 213 members 4,386 guests
Please welcome our newest community members: