cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
ThomasVDS
Helper III
Helper III

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

@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...

 

View solution in original post

4 REPLIES 4
v-xida-msft
Community Support
Community Support

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.

@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

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.

@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...

 

View solution in original post

Helpful resources

Announcements
PA User Group

Welcome to the User Group Public Preview

Check out new user group experience and if you are a leader please create your group

MBAS Attendee Badge

Claim Your Badge & Digital Swag!

Check out how to claim yours today!

secondImage

Demo Extravaganza is Back!

We are excited to announce that Demo Extravaganza for 2021 has started!

MBAS on Demand

Microsoft Business Applications Summit sessions

On-demand access to all the great content presented by the product teams and community members! #MSBizAppsSummit #CommunityRocks

Power Apps June 2021

June Power Apps Community Call

Don't miss the call this month on June 16th - 8a PDT

Top Kudoed Authors
Users online (64,020)