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 Apps / Button Multiple action
Power Apps
Answered

Button Multiple action

(0) ShareShare
ReportReport
Posted on by 521

Hi 

 

I have a button and would like to perform a multiple action IF statements below code i have tried but only does the first statement can you help please 
This code is on OK button Onselect

 

If(
 SingleField_2.varSelectedAction = 1,
 Notify(
 "Task Comming Soon",
 NotificationType.Information
 ),
 If(
 SingleField_2.varSelectedAction = 2,
 Notify(
 "Email Comming Soon",
 NotificationType.Information
 ),
 If(
 SingleField_2.varSelectedAction = 3,
 Patch(xxxxx
 
 )
 )
 )
)

 

 

 

Categories:
I have the same question (0)
  • CU-18081211-6 Profile Picture
    9,272 Moderator on at

    @PowerApps11 ,

    Can you give more info about:

    SingleField_2.varSelectedAction

    What is it ? How you change its value ?

    At a first look, you can use switch function() for a clear code. 

    Switch(SingleField_2.varSelectedAction,
     1,
     Notify(
     "Task Comming Soon",
     NotificationType.Information
     ),
     2,
     Notify(
     "Email Comming Soon",
     NotificationType.Information
     ),
     3,
     Patch(
     'Ramole Check Management',
     varItem,
     {note: varItem.note & User().FullName & " - " & Now() & " - " & RequestForm.Text & "<br>" & "<br>"}
     )
     )
  • PowerApps11 Profile Picture
    521 on at

    Hi @gabibalaban 

     

    SingleField_2

    Thats components name and the buttons on collection example Task etc 

    varSelectedAction

    Output so i can used outside the components 

  • Verified answer
    CU-18081211-6 Profile Picture
    9,272 Moderator on at

    @PowerApps11 ,

    Let's check if the component returns the corect selected action. Put a Label on the Screen and set the Text property to 

    SingleField_2.varSelectedAction

    and then try to switch between actions to see the value of the label is changing. 

     

  • PowerApps11 Profile Picture
    521 on at

    Hi @gabibalaban 

    Is returning the 1 2 3 but when click the action its only perfoming the first action. Task

     Notify(
     "Task Comming Soon",
     NotificationType.Information
     )

     

    I dont why 

  • PowerApps11 Profile Picture
    521 on at

    Hi @gabibalaban 

     

    I have test it single patch and its perfoming as expected whatever i write in the text box is returning to the datasource

  • PowerApps11 Profile Picture
    521 on at

    Hi @gabibalaban 

     

    I Have made some changes on my output components as you see on the code, used my original IF Statements as Switch was not doing its job like example
    When I click Task it works ok  and when I click Email button it does both Email & Notes so I do not know why but now all works thanks for your help.

     

    If(
     SingleField_2.SelectedItems.ID = 1,
     Notify(
     "Task Comming Soon",
     NotificationType.Information
     ),
    SingleField_2.SelectedItems.ID = 2,
     Notify(
     "Email Comming Soon",
     NotificationType.Information
     ),
     SingleField_2.SelectedItems.ID = 3,
     Patch({})
     )
     )
    )

     

     

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

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the July Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 329 Most Valuable Professional

#2
11manish Profile Picture

11manish 209 Super User 2026 Season 2

#3
Mohsin Ali Profile Picture

Mohsin Ali 179

Last 30 days Overall leaderboard