cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
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
Highlighted
Community Support
Community Support

Re: Multiple Users Approvals

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
Highlighted
Community Support
Community Support

Re: Multiple Users Approvals

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
secondImage

Demo-Extravaganza 2020

Check out these cool Power Apps & vote on your favorite!

secondImage

Robotic Process Automation

Let's talk about the solution provided by Microsoft for Robotic Process Automation (RPA)

secondImage

Community Highlights

Check out whats happening in Power Apps

secondImage

Community User Group Member Badges

FIll out a quick form to claim your community user group member badge today!

Top Solution Authors
Top Kudoed Authors
Users online (5,789)