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
yashag2255
Dual Super User II
Dual Super User II

@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 II
Super User II

Hi @StevieC 

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

yashag2255
Dual Super User II
Dual Super User II

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

 

yashag2255
Dual Super User II
Dual Super User II

@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

That's the ticket! 🙂  Thanks for your help

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

Are Your Ready?

Test your skills now with the Cloud Skill Challenge.

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

Top Solution Authors
Top Kudoed Authors
Users online (80,298)