web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Mandatory fields for S...
Power Apps
Unanswered

Mandatory fields for Sharepoint form using Submit, collect & patch coding

(0) ShareShare
ReportReport
Posted on by

Hi all, I know there's multiple ways to do this but I'm keen to try to maintain consistency. 

 

I have a form linked to two datasources - database 1 uses lookup from database 2. It uses submit () written into onSubmit (submitting within sharepoint) - this submits most of the information to the database 1. I've made one field required and if left empty the following error pops up (this is out of the box) upon pressing submit.

 

yunkitho_0-1687302641365.png

 

I have another set of fields (made visible when I toggle add New) and the data is collected into database 2 and then patched into database 1. Essentially an Add entry if the field doesn't already exist in database 2. 

 

I want to make the fields that appear on Add New to also be mandatory and keep the consistency of the out of the box error.

 

I couldn't do this by just making this required on both side so have had to resorted to using an if() function to check if the field is blank and stop the collect / patch as well as if() function to stop the submit of the form. Now I just need to have the error text pop up and field border change colour upon submitting if the field is blank which is where I'm having difficulty. 

 

I tried setting the visibility as a variable (bVisible) and then having the text visible when bVisible = true. Then I tried to use UpdateContext to change the bVisible from false to true conditionally which works - however I can't insert this into the onsubmit property of the SharePointintegration.

 

Any advice is appreciated and if there's an easier way to do this I am all ears!

yunkitho_2-1687303328538.png

yunkitho_3-1687303336253.png

yunkitho_4-1687303346155.png

yunkitho_5-1687303355111.png

 

 

 

Categories:

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

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 432 Super User 2026 Season 2

#2
Mohsin Ali Profile Picture

Mohsin Ali 347

#3
WarrenBelz Profile Picture

WarrenBelz 254 Most Valuable Professional

Last 30 days Overall leaderboard