Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Turn off approval process #154

Open
bouncethebox opened this issue Sep 23, 2020 · 10 comments
Open

Turn off approval process #154

bouncethebox opened this issue Sep 23, 2020 · 10 comments
Assignees
Labels
good first issue Good for newcomers help wanted Extra attention is needed

Comments

@bouncethebox
Copy link

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

@bouncethebox
Copy link
Author

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!

@SPB21
Copy link

SPB21 commented Sep 29, 2020

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

@alexc-MSFT
Copy link
Member

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

@alexc-MSFT alexc-MSFT added help wanted Extra attention is needed good first issue Good for newcomers labels Sep 29, 2020
@thondal-evry
Copy link

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

@bouncethebox
Copy link
Author

bouncethebox commented Oct 6, 2020

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...

@alexc-MSFT
Copy link
Member

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

Thanks

@thondal-evry
Copy link

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

@bouncethebox
Copy link
Author

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!

@MartinKleynhans
Copy link

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.

@Pratikd-msft
Copy link

@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 ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

6 participants