microsoft-teams-apps-requestateam icon indicating copy to clipboard operation
microsoft-teams-apps-requestateam copied to clipboard

Turn off approval process

Open bouncethebox opened this issue 3 years ago • 10 comments

Hey guys - how can I disable the approval workflow for the teams requests through the apps?

bouncethebox avatar Sep 23 '20 20:09 bouncethebox

This was previously answer with, "yes, the easiest way to do this would be simply to disable the Flow and set the status of the request directly to 'Approved' within the Power App."

Just not sure where this change needs to be made, any help would be great!

bouncethebox avatar Sep 29 '20 00:09 bouncethebox

Hi @bouncethebox, we have done something similar and set the status of the request to 'Approved' when the user clicks the 'Submit' button on the review step. Update btnSubmit_ReviewAndSumbit OnSelect method and set the following in the 'Patch' command:

Patch( 'Teams Requests', First( Filter( 'Teams Requests', RowKey = Text(rowguid) ) ),{Comments: "System Auto Approved."}, { Status: { '@odata.type': "#Microsoft.Azure.Connectors.SharePoint.SPListExpandedReference", Value: "Approved" } }, { Stage: { '@odata.type': "#Microsoft.Azure.Connectors.SharePoint.SPListExpandedReference", Value: "Submitted" } } ); Here we are setting the Status = Approved and the comment = 'System Auto-approved.

For the 'Edit Request' screen you need to update the dcvStatus_EditRequest 'DefaultSelectedItems' property to set the Value to 'Approved':

If(changetosubmit,{'@odata.type':"#Microsoft.Azure.Connectors.SharePoint.SPListExpandedReference", Value:"Approved"} ,Parent.Default)

Hope this helps

SPB21 avatar Sep 29 '20 07:09 SPB21

@bouncethebox please try as @SPB21 suggests. @SPB21 I'm going to assign this one to you, hope this is ok.

alexc-MSFT avatar Sep 29 '20 14:09 alexc-MSFT

Changing the value from "submitted" to approved made the trick for us. Have not added any comments like @SPB21 , but changing just the value to submitted autotriggers the logic app

thondal-evry avatar Oct 01 '20 07:10 thondal-evry

Hey! I totally didn't mean to be one of those guys that takes solutions and doesn't come back. I wasn't able to get this to work, I'm sure its something I am missing.

I was able to get it to blow through the approval process by changing 'update status to pending approval' value 'Pending Approval' to 'Approved' in the logic app.

I would much rather do it your way than the duct tape and zip ties I used.

Also, do you know where I can edit the approval workflow message the user receives after they submit the request? This way I can change the button to 'Ok' and the verbiage to 'Your request has been submitted' etc...

bouncethebox avatar Oct 06 '20 00:10 bouncethebox

@thondal-evry are you ok to assist @bouncethebox please?

Thanks

alexc-MSFT avatar Oct 08 '20 08:10 alexc-MSFT

@bouncethebox what/where did you change? What is not working and how would you like it to work?

thondal-evry avatar Oct 08 '20 16:10 thondal-evry

I was able to properly bypass the approval workflow in UseTemplate and BuildNew, and later realized I also have to do it in grpEditRequest as well - but I'm good to go, thanks so much!

bouncethebox avatar Oct 28 '20 03:10 bouncethebox

Is it possible to have this based on a Variable? Like for Example if i added a switch to the form, id like the approval to be skipped if the value is set to something and then only required if the value is not set.

MartinKleynhans avatar Feb 23 '21 11:02 MartinKleynhans

@thondal-evry @SPB21 - I Update the btnSubmit_ReviewAndSumbit OnSelect method and dcvStatus_EditRequest 'DefaultSelectedItems' property. Auto approval still does not seem to work. Once the request is Submitted, the status still shows as submitted. Anything else I need to do for auto approval to work ?

Pratikd-msft avatar May 20 '21 14:05 Pratikd-msft