cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Julien2
Post Prodigy
Post Prodigy

Multiple Users Approvals

Hello,

I have a SharePoint list that I am customizing it using PowerApps forms.
In this list, I have three columns and are single lines of text (Approval I, Approval II, Approval III).

In this form, I have a dropdown where the users will pick their email addresses, and submit.

What I want to achieve is the following:

On submission, I want to update the above fields that I have mentioned to "Approved". Besides, before updating the field I want to check if it's already approved or not to notify the user based on the response ("This item is already approved, you cannot approve it again!") or ("This item has been successfully approved!").

The submit button will react to all the users in the dropdown with the same process in different fields.

I was able to achieve it using a toggle when I had two approvals only, please have a look at the below formula:

Set(
   VManager2,
   Toggle1.Value
);
Set(
   vID,
   SharePointIntegration.SelectedListItemID
);

If(
   VManager2,
   Set(
      vNotApproved,
      IsBlank(
         First(
         Filter(
            'Employee re-joining report', 
            ID = vID && 
            ApprovalI = "Approved"
         )
         )
      )
   ),
   Set(
      vNotApproved,
      IsBlank(
           First(
         Filter(
            'Employee re-joining report', 
            ID = vID && 
            ApprovalII= "Approved"
         )
        )
      )
   )
);
If(      
   !vNotApproved,
   Notify(
      "This item is already approved, you cannot approve it again!", 
      NotificationType.Error
   ),
      If(
      VManager2,
      UpdateIf(
         'Employee re-joining report',
         ID = vID,
         {ApprovalI:"Approved"}
         
      ),
	  UpdateIf(
         'Employee re-joining report',
         ID = vID,
         {ApprovalII:"Approved"}
      )
   );
   If(!VManager2,
    Notify(
         "This item has been signed successfully!", 
         NotificationType.Success
      )                
      
    )
);

Currently, I have more than two approvals, I just want to know would be the updated function to be able to achieve the above scenario. So I can continue to implement the same logic for other approvals(4-5..).

I would be most grateful if you please provide an example and explain it in detail.

Any help is highly appreciated.

Thank you!

1 ACCEPTED SOLUTION

Accepted Solutions
v-yutliu-msft
Community Support
Community Support

Hi @Julien2 ,

Do you want to change your formula for three approvals?

Could you show me your custom form's screen shoot?

Since I am not so sure about your layout, I could not fully understand the formula that you used.

Especially the usage of Toggle1, and the drop downs.

I know you want to update three approval fields, what are the email addressed used for?

 

To justify whether the fields are "Approved", you just need to use toggles. Make the toggles display the selected item's approval fields.

For example:

1)insert three toggles

set toggle1's Default:

 

If(ThisItem.'Approval I'="Approved",true,false)

 

set toggle1's DisplayMode:

If(ThisItem.'Approval I'="Approved",Disabled,DisplayMode.Edit)

set toggle2's Default:

 

If(ThisItem.'Approval II'="Approved",true,false)

 

et toggle2's DisplayMode:

 

If(ThisItem.'Approval II'="Approved",Disabled,DisplayMode.Edit)

 

set toggle3's Default:

 

If(ThisItem.'Approval III'="Approved",true,false)

 

et toggle3's DisplayMode:

 

If(ThisItem.'Approval III'="Approved",Disabled,DisplayMode.Edit)

 

Toggle1,toggle2,toggle3 will display approval1,approval2,approval3 value by default.

If its value has already been approved, the toggle will be disbaled.

 

2)set the submit button's OnSelect:

Set(var1,If(ThisItem.'Approval I'="Approved",true,false));
Set(var2,If(ThisItem.'Approval II'="Approved",true,false));
Set(var3,If(ThisItem.'Approval III'="Approved",true,false));
If(!var1&&Toggle1.Value,
   Patch('Employee re-joining report',ThisItem,{'Approval I'="Approved"};
   Notify(
         "This item has been signed successfully!", 
         NotificationType.Success
      )         
);
If(!var2&&Toggle2.Value,
   Patch('Employee re-joining report',ThisItem,{'Approval II'="Approved"};
   Notify(
         "This item has been signed successfully!", 
         NotificationType.Success
      )         
);
If(!var3&&Toggle3.Value,
   Patch('Employee re-joining report',ThisItem,{'Approval III'="Approved"};
   Notify(
         "This item has been signed successfully!", 
         NotificationType.Success
      )         
)

 If the item has been updated successfully, you will get notification.

5264.PNG

 

Best regards,

Community Support Team _ Phoebe Liu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

1 REPLY 1
v-yutliu-msft
Community Support
Community Support

Hi @Julien2 ,

Do you want to change your formula for three approvals?

Could you show me your custom form's screen shoot?

Since I am not so sure about your layout, I could not fully understand the formula that you used.

Especially the usage of Toggle1, and the drop downs.

I know you want to update three approval fields, what are the email addressed used for?

 

To justify whether the fields are "Approved", you just need to use toggles. Make the toggles display the selected item's approval fields.

For example:

1)insert three toggles

set toggle1's Default:

 

If(ThisItem.'Approval I'="Approved",true,false)

 

set toggle1's DisplayMode:

If(ThisItem.'Approval I'="Approved",Disabled,DisplayMode.Edit)

set toggle2's Default:

 

If(ThisItem.'Approval II'="Approved",true,false)

 

et toggle2's DisplayMode:

 

If(ThisItem.'Approval II'="Approved",Disabled,DisplayMode.Edit)

 

set toggle3's Default:

 

If(ThisItem.'Approval III'="Approved",true,false)

 

et toggle3's DisplayMode:

 

If(ThisItem.'Approval III'="Approved",Disabled,DisplayMode.Edit)

 

Toggle1,toggle2,toggle3 will display approval1,approval2,approval3 value by default.

If its value has already been approved, the toggle will be disbaled.

 

2)set the submit button's OnSelect:

Set(var1,If(ThisItem.'Approval I'="Approved",true,false));
Set(var2,If(ThisItem.'Approval II'="Approved",true,false));
Set(var3,If(ThisItem.'Approval III'="Approved",true,false));
If(!var1&&Toggle1.Value,
   Patch('Employee re-joining report',ThisItem,{'Approval I'="Approved"};
   Notify(
         "This item has been signed successfully!", 
         NotificationType.Success
      )         
);
If(!var2&&Toggle2.Value,
   Patch('Employee re-joining report',ThisItem,{'Approval II'="Approved"};
   Notify(
         "This item has been signed successfully!", 
         NotificationType.Success
      )         
);
If(!var3&&Toggle3.Value,
   Patch('Employee re-joining report',ThisItem,{'Approval III'="Approved"};
   Notify(
         "This item has been signed successfully!", 
         NotificationType.Success
      )         
)

 If the item has been updated successfully, you will get notification.

5264.PNG

 

Best regards,

Community Support Team _ Phoebe Liu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

Helpful resources

Announcements
PA_User Group Leader_768x460.jpg

Manage your user group events

Check out the News & Announcements to learn more.

secondImage

Power Apps Community Call

Please join us on Wednesday, October 20th, at 8a PDT. Come and learn from our amazing speakers!

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

Welcome Super Users.jpg

Super User Season 2

Congratulations, the new Super User Season 2 for 2021 has started!

Carousel 2021 Release Wave 2 Plan 768x460.jpg

2021 Release Wave 2 Plan

Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.

Top Solution Authors
Top Kudoed Authors
Users online (1,989)