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

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / Approval Workflows in ...
Power Automate
Unanswered

Approval Workflows in Power Apps

(0) ShareShare
ReportReport
Posted on 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?

 

Categories:
I have the same question (0)
  • v-xiaochen-msft Profile Picture
    Microsoft Employee on at

    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

  • gabequinn__ Profile Picture
    32 on at

    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
    Microsoft Employee on at

    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 at

    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

     

     

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Leaderboard > Power Automate

#1
David_MA Profile Picture

David_MA 103 Super User 2026 Season 1

#2
Haque Profile Picture

Haque 87

#3
trice602 Profile Picture

trice602 63 Super User 2026 Season 1

Last 30 days Overall leaderboard