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

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Programming in PowerApps
Power Apps
Unanswered

Programming in PowerApps

(1) ShareShare
ReportReport
Posted on by 7

I've been wrestling with a few programming limitations, and I hope it's just my lack of knowledge that's the issue.

 

My organization is beginning to look into PowerApps for SharePoint data display because we don't have any teams large enough to warrant custom code solutions; I'm essentially the only programmer right now.  I'm hitting a few walls with the functions natively provided, and most solutions from various Excel boards tell me to use macros and write custom Visual Basic, but I see no such functionality in PowerApps to write custom code.

 

I'm attempting to make a really interactive UI where many OnSelect clicks in many locations will each fire off dozens of events to change lots of control properties and global variables.  It seems that the only solution I have right now is to copy and paste these dozens of formulas into dozens of OnSelect functions, and I don't want to think about the maintenance of this app in the long-term if that's what needs to be done.

 

Here are a few basic questions to help narrow down my options.

 

1.  Can I fire off multiple events from a single IF statement?  (I want to write function blocks but I don't know how.)  For example:

IF(condition, (statement; statement; statement; statement), default)

2.  Can I edit control properties directly?  For example, the first method works, but I can't make 400+ global variables, so I want to use the second method but it doesn't work:

Method 1:
 set the OnStart property to
Set(globalVariableXPos, 40)
 set the X property of Rectangle1 to
globalVariableXPos
 set the OnSelect property of a button to
Set(globalVariableXPos, globalVariableXPos + 40)

Method 2:
 set the OnSelect property of a button to
Set(Rectangle1.X, Rectangle1.X + 40)

3.  Is there a native way to write custom code in PowerApps, regardless of the language?  I keep telling everyone that I can build these solutions from scratch in various languages, but they want quick-and-easy solutions (which continually have bugs and limitations which end up get released with tons of quirks all the time).  If I could access the backend of PowerApps to add a bit of functionality and data validation, I can give them quick PowerApps solutions which limit the amount of programming I have to do, but it will still be robust and up-to-spec as I get the time to program these features over time.

 

Edit: I found the following resource, but I don't want to have to query a server dozens of times to implement basic UI commands and perform general calculations.  Is there another way?

https://powerapps.microsoft.com/en-us/blog/using-azure-functions-in-powerapps/

Categories:
I have the same question (0)
  • Verified answer
    Community Power Platform Member Profile Picture
    on at

    Hi @Flarebrass

     

    1. 

    Yes you can fire multiple statements from one if

     

    For example:

    If(
     MyBooleanVariable,
    
     UpdateContext({variable1:1});
     Set(variable2,2);
     ClearCollect(Variable3Collection,MySQLDataSource),
    
     UpdateContext({variable4:4});
     Set(variable5,5);
     ClearCollect(Variable6Collection,MySQLDataSource)
    )
    
    

    2.

    Yeah, the way PowerApps is build you cannot use Method 2 only Method 1. I know it’s hard to understand if common from programmers background but PowerApps works more like Excel with Functions.

     

    3.

    Currently there is no way to writte custom code in PowerApps

     

     

  • MikeInLACalif Profile Picture
    12 on at

    Dumb... PowerApps will never really take off until it has it's own built-in programming language like an updated form of VBA that all office developers know.... You can't place everything in huge long "IF" statements.... When I click on a button I should be able to execute whatever code I want... LOL... Mike in Los Angeles, Calif

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

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 717 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 329 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard