Skip to main content

Notifications

Power Apps - Building Power Apps
Unanswered

Two Functions in Button

(2) ShareShare
ReportReport
Posted on by

I'm having trouble adding two functions to the same button, "SubmitForm(EditForm1)" and "Navigate(Screen 2)".  Both functions work perfectly when called separately, but I can't seem to get them to work together.

  • LaurensM Profile Picture
    LaurensM 12,510 on at
    Re: Two Functions in Button

    Hi @GabrielJardimRp,

     

    What specific error are you receiving? When working with a Form control it is recommended to write your code, that only needs to run after a successfull submission, within the Form's OnSuccess property instead of chaining them in the Submit Button's OnSelect.

     

    //Button OnSelect
    SubmitForm(EditForm1)
    
    //Form OnSuccess
    //Note: screen names with a space should be enclosed in single quotes
    //Without a space this is not required: Navigate(Screen2)
    Navigate('Screen 2')

     

    To combine functions, you can use the chaining operator - which is dependent on your language decimal operator:

    //Language with a comma decimal separator
    Function1();; Function2()
    
    //Language with a dot decimal separator
    Function1(); Function2()

     


    If this solves your question, would you be so kind as to accept it as a solution✔️

    If you liked my solution, please give it a thumbs up👍

     

    Connect with me: LinkedIn | Blog

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

Microsoft Kickstarter Events…

Register for Microsoft Kickstarter Events…

Announcing Our 2025 Season 1 Super Users!

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

Announcing Forum Attachment Improvements!

We're excited to announce that attachments for replies in forums and improved…

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 145,636

#2
RandyHayes Profile Picture

RandyHayes 76,287

#3
Pstork1 Profile Picture

Pstork1 64,942

Leaderboard