microsoft-teams-apps-requestateam
microsoft-teams-apps-requestateam copied to clipboard
Turn off approval process
Hey guys - how can I disable the approval workflow for the teams requests through the apps?
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!
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
@bouncethebox please try as @SPB21 suggests. @SPB21 I'm going to assign this one to you, hope this is ok.
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
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...
@thondal-evry are you ok to assist @bouncethebox please?
Thanks
@bouncethebox what/where did you change? What is not working and how would you like it to work?
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!
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.
@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 ?