Skip to main content

Notifications

Power Apps - Building Power Apps
Suggested answer

An entry is required or has an invalid value

Posted on 12 Dec 2024 17:55:01 by 686
Started getting the error 'An entry is required or has an invalid value', when submitting a form. There was one column which was set to required in the SharePoint list settings which is always filled when testing the app. I also check the form to see if it is valid else the "Save" button will be disabled so I know all required fields are filled in on the application.
 
The code below just check to see if there is an error with the information entered on the form. If there is an error it will show an error message else a loading screen is displayed, the form is submitted and the variable is updated with the record from the last record submitted.
 
Save Button code
Set(gblFormStatus, Blank());
 
If(And(CountRows(Filter(colProgAmendOption, Selection = "Yes" && Title = "Increase or decrease in Total Programme Credits")) = 0, Not(txtSugCredit_3.Text = txtSugCredit_4.Text)),
    Set(showCreditsWarning, true), //Show error message
    Set(showLoading, true)//Show loading screen
    SubmitForm(frmAmmendment_)//Submit form
    Set(gblCurrentForm, frmAmmendment_.LastSubmit)//Update variable which stores the current record information and updates it with the updated information
    Set(showLoading, false//Hide loading screen
)
 
The issue seems to be caused by the "Set(gblFormStatus, Blank());" since once removed I am able to save the record. This variable is used in the Default property of a data card in the form. However the field is not a required field on the app nor on SharePoint.
 
 
Data card Default property code
Coalesce(gblFormStatus,ThisItem.FormStatus)
 
 
 
Categories:
  • WarrenBelz Profile Picture
    WarrenBelz 143,595 on 14 Dec 2024 at 05:48:54
    An entry is required or has an invalid value
    Try sending an empty string instead of Blank()
    Set(gblFormStatus, "");
    Also what type of field are you writing back to - if it is a Choice field
    Set(gblFormStatus,{Value: ""});
     
    Please click Does this answer your question if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it a Like.
    MVP (Business Applications)    Visit my blog Practical Power Apps    Buy me a coffee
  • rpersad Profile Picture
    rpersad 686 on 13 Dec 2024 at 13:58:14
    An entry is required or has an invalid value
    Did check the SharePoint list and found that the FormStatus column in the SharePoint list has a default value "NEW" set to it. I have to assume due to the processing the logic of the app which is causing the error. Decided to remove the Set(gblFormStatus, Blank()) 

    Though this issue started happening this week while before I had no issues. 
  • Suggested answer
    Garima_PowerPlatform Profile Picture
    Garima_PowerPlatform 107 on 13 Dec 2024 at 00:56:16
    An entry is required or has an invalid value
    Hi

    "An entry is required or has an invalid value" typically occurs when there is a validation issue with a required field or when the form is not properly handling all input data. Given your explanation, it seems that Set(gblFormStatus, Blank()); might be clearing some required data unexpectedly.
    • Check Required Fields:

      • Even if the field is not set as required in the SharePoint list settings, it could still be required by the form itself. Verify if any data card within the form has its Required property set to true.
    • Default Property in Data Card:

      • Coalesce(gblFormStatus, ThisItem.FormStatus) is likely expecting a valid entry. If gblFormStatus is being set to Blank(), it could cause the data card to fail validation when trying to pull a value from it.
    • Variable Reset Issue:

      • Ensure that gblFormStatus is not set to Blank() unless absolutely necessary. If it’s not required, try removing Set(gblFormStatus, Blank()) entirely or conditionally setting it.
    • Check Data Validation:

      • Inspect all data cards and ensure none are set as required that are not properly handled when gblFormStatus is cleared.


    If(
        And(CountRows(Filter(colProgAmendOption, Selection = "Yes" && Title = "Increase or decrease in Total Programme Credits")) = 0, Not(txtSugCredit_3.Text = txtSugCredit_4.Text)),
        Set(showCreditsWarning, true), // Show error message
        SubmitForm(frmAmmendment_); // Submit form
        Set(gblCurrentForm, frmAmmendment_.LastSubmit); // Update variable
    )

    Please click Does this answer your question if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it a Like.
     
  • ronaldwalcott Profile Picture
    ronaldwalcott 1,203 on 12 Dec 2024 at 19:53:08
    An entry is required or has an invalid value
    What is the purpose of Set(gblFormStatus, Blank()) if you have the default property code set to Coalesce(gblFormStatus,ThisItem.FormStatus)
  • timl Profile Picture
    timl 32,074 on 12 Dec 2024 at 18:30:13
    An entry is required or has an invalid value
    Have you refreshed the SharePoint data source in your app? It might be worth doing that as a first step to see if it helps. 

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

November 2024 Newsletter…

November 2024 Community Newsletter…

Community Update Oct 28…

Power Platform Community Update…

Tuesday Tip #7 Community Profile Tips…

Welcome to a brand new series, Tuesday Tips…

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 143,595

#2
RandyHayes Profile Picture

RandyHayes 76,308

#3
Pstork1 Profile Picture

Pstork1 64,098

Leaderboard