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

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Data validation in 2 s...
Power Apps
Answered

Data validation in 2 steps based on the role

(0) ShareShare
ReportReport
Posted on by 112

Hello.

I am developing custom forms of Sharepoint list and would like to set data validation for 2 steps based on role.

 

Form

Status

Role

Data Validation for required

Formula of data validation

NewForm

1.Draft

HR

The field which HR should input

 Required: true in NewForm

Edit Form

2.In progress by Manager

Manager

The field which Managers should input

 

 

If the status is “2.In progress by Manager”,

Required in Edit Form:

If(DataCardValueXXX.Text=

"2.In progress by Manager",true,false)

 

 

 

When HR clicks the submit button, the validation which was required for Manager will be triggered and we can't proceed.

How I can separate two validation check for 2 steps?

Categories:
I have the same question (0)
  • v-qiaqi@microsoft.com Profile Picture
    on at

    Hi @Glueck,

    Do you want to make the field required based on the user role and form mode?

    Could you please tell me that:

    1). how you define the status from a ner form, is there is a dropdown control to select status? I found that the two conditions seems to be so similar, you should tell me that how you capture the status respectively in new form and edit form

    2). how you define the user role of the user who submits the form, the user who fills the form will select the Role?

     

  • Glueck Profile Picture
    112 on at

    Hi @v-qiaqi-msft 

     

    Thank you very much for your comment🙂

     

    1). how you define the status from a ner form, is there is a dropdown control to select status? I found that the two conditions seems to be so similar, you should tell me that how you capture the status respectively in new form and edit form

    For the definition of the status, “Draft” is set as Default in SharepontList.

    When HR submit the new form, the status will be changed to “1.In progress by Manager” which formula is OnSelect:Set(varStatus,"1.In progress by Manager");SubmitForm(NewForm1);

     

    2). how you define the user role of the user who submits the form, the user who fills the form will select the Role?

     

    1.One member from HR ,who is granted as Admin role from the beginning, will edit a new form as Draft.

    2.HR will select a Manager from "Hiring manager name" and submit this new form to the selected Manager.

    3.Then the manager will open and edit the same form as Edit Form.

     

    I would like to set so that one Validation for NewForm can work only for HR member and another Validation for EditForm can work only for Manager.

     

    But when HR clicks the submit button, the validation which is set for Manager, works incorrectly and HR can't submit.newform.jpgEdit.jpg

  • Verified answer
    Glueck Profile Picture
    112 on at

    @v-qiaqi-msft 

     

    Seems setting two validation  for 2 form based on role is ineffective.

     

    According to this sitePowerApps Validation Examples On/before Submitting | Power Apps (devoworx.net).

    I found validating the data when the user leaves the current field and moves to the next one could be effective.

     

    I decided to stop to use "Required" filed and will validate when the user leaves the current field, not on submit.

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

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 765 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 343 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 272

Last 30 days Overall leaderboard