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

Sharepoint list form set error

I am editing a form for a sharepoint list in PowerApps.  I want to add additional validation to my form but i cant work out how to stop the form being able to be saved?

 

At the moment i have set the Text property of the error message like this:

 

If("For Sale" in DataCardValue2.Text, "dont use for sale", Parent.Error).

 

This works - the error shows if they use For Sale and also shows the standard error if the field is empty (its a required field), but the user can still save the form in the first instance.

cheers

 

 

1 ACCEPTED SOLUTION

Accepted Solutions

@StevieC 

 

I see what you are trying to say. In that case, you can update the OnSave property of the SharePoint Integration to below expression:

If("For Sale" in DataCardValue2.Text, Notify("Error Message", NotificationType.Error), SubmitForm(SharePointForm1))

 

 

Hope this Helps!

 

If this reply has answered your question or solved your issue, please mark this question as answered. Answered questions helps users in the future who may have the same issue or question quickly find a resolution via search. If you liked my response, please consider giving it a thumbs up. THANKS!

View solution in original post

6 REPLIES 6
Drrickryp
Super User
Super User

Hi @StevieC 

Put the condition in the Display mode of the button and set it's default to disabled.

Hi @StevieC 

 

This is because even though the error message shows, there is no restriction on the submit of this form. You can configure this by disabling the Submit button if the "For Sale" keyword exist in your input control.

Submit Button -> DisplayMode -> If("For Sale" in DataCardValue2.Text, DisplayMode.Disabled, DisplayMode.Edit)

 

 

Hope this Helps!

 

If this reply has answered your question or solved your issue, please mark this question as answered. Answered questions helps users in the future who may have the same issue or question quickly find a resolution via search. If you liked my response, please consider giving it a thumbs up. THANKS!

Unfortunately its not that simple as this is a SharePoint form edited in PowerApps, so the save button isnt part of the form (not sure how this works!)

Hi - see my response above - cheers

 

@StevieC 

 

I see what you are trying to say. In that case, you can update the OnSave property of the SharePoint Integration to below expression:

If("For Sale" in DataCardValue2.Text, Notify("Error Message", NotificationType.Error), SubmitForm(SharePointForm1))

 

 

Hope this Helps!

 

If this reply has answered your question or solved your issue, please mark this question as answered. Answered questions helps users in the future who may have the same issue or question quickly find a resolution via search. If you liked my response, please consider giving it a thumbs up. THANKS!

That's the ticket! 🙂  Thanks for your help

Helpful resources

Announcements
Power Platform Call June 2022 768x460.png

Power Platform Community Call

Join us for the next call on August 17, 2022 at 8am PDT.

Power Platform Conf 2022 768x460.jpg

Join us for Microsoft Power Platform Conference

The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.

365 EduCon 768x460.png

Microsoft 365 EduCon

Join us for two optional days of workshops and a 3-day conference, you can choose from over 130 sessions in multiple tracks and 25 workshops.

Users online (7,196)