web
You’re offline. This is a read only version of the page.
close
Skip to main content
Community site session details

Community site session details

Session Id : 8REX08dgMJD55zUej8risq
Power Automate - Building Flows
Unanswered

Approval Workflows in Power Apps

Like (0) ShareShare
ReportReport
Posted on 23 May 2023 21:26:02 by 32

Hi All, 

 

I've been following Reza's tutorial for creating approval workflows in Power Apps and deep linking (https://www.youtube.com/watch?v=Om4beefKmV0) since I'm trying to have the entire workflow be within Power Apps. Everything goes well but when I test the flow I get the following error in Power Apps: Run failed: The method 'Run' has an invalid value for parameter 'number'- this is what the flow looks like for that portion: 

 

gabequinn___0-1684877085024.png

 

 

Here is how it is set up

 

Within the form:

OnSuccess- If(varFormMode = FormMode.New, TMApproval.Run(New_TM_Form.LastSubmit.ID);); Notify("TM updated successfully",NotificationType.Success); Navigate('Home Screen')

 

Thoughts?

 

  • gabequinn__ Profile Picture
    32 on 25 May 2023 at 20:19:26
    Re: Approval Workflows in Power Apps

    Thanks @v-xiaochen-msft 

     

    I've stored the variable (varItem) in the on success attribute (see below): 

     

    //on success send email to approver email
    ViewForm(New_TM_Form);
    Set(varItem, New_TM_Form.LastSubmit);
    If(varItem.Status.Value="Pending Approval",
    Office365Outlook.SendEmailV2(
    varItem.'Approver'.Email,
    "TM Submission - Approval Required",
    "A TM was submitted for "&varItem.'Subject of the TM'.DisplayName&" on "&varItem.'Date conflict identified'&". <a href="""&varAppID&"?ID="&varItem.ID&""">Click here</a> to approve/reject the TM."
    )
    )

     

    The email gets sent but when I click it still goes to the home page with the correct ID

     

    gabequinn___1-1685045953782.png

     

     

  • v-xiaochen-msft Profile Picture
    on 25 May 2023 at 01:29:16
    Re: Approval Workflows in Power Apps

    Hi @gabequinn__ ,

     

    In Powerapps.

    Usually, we can use formula <Set(var,New_TM_Form.LastSubmit.ID)> to save it. It's a global variable in the app.

    We can use the formula in the button when we submit the form. SubmitForm(form);Set(var,New_TM_Form.LastSubmit.ID)

     

    Or we can use it on onsuccess attribute of the form:

    Set(var,New_TM_Form.LastSubmit.ID)

     

    The benefit is that it allows us to troubleshoot the problem simply.

    After creating the variable, we can add a label to display the value of the variable.

     

    Best Regards,

    Wearsky

     

  • gabequinn__ Profile Picture
    32 on 24 May 2023 at 12:05:27
    Re: Approval Workflows in Power Apps

    Thanks for the reply @v-xiaochen-msft 

     

    When you say save the ID value to a variable first- do you mean  in power apps or power automate? If in power apps, how?

  • v-xiaochen-msft Profile Picture
    on 24 May 2023 at 02:08:23
    Re: Approval Workflows in Power Apps

    Hi @gabequinn__ ,

     

    I guess the value of New_TM_Form.LastSubmit.ID is cleared because of some wrong operations.

    Can you save the ID value to a variable first when submitting the data?

    Then we can use the variable instead of using New_TM_Form.LastSubmit.ID.

     

    Best Regards,

    Wearsky

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Announcing our 2025 Season 2 Super Users!

A new season of Super Users has arrived, and we are so grateful for…

Paul Stork – Community Spotlight

We are honored to recognize Paul Stork as our July 2025 Community…

Congratulations to the June Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 497 Super User 2025 Season 2

#2
David_MA Profile Picture

David_MA 436 Super User 2025 Season 2

#3
Riyaz_riz11 Profile Picture

Riyaz_riz11 244 Super User 2025 Season 2

Loading complete