Jukka Niiranen’s Post

View profile for Jukka Niiranen

The Original Power Platform Advisor. 11x Microsoft MVP. Low-code 4 life.

The low-code programming language of #PowerPlatform has 2 sides: declarative (like Excel) and imperative (like JavaScript). Most of us who spend our working days in front of a computer have been using #Excel for creating formulas to calculate values, do simple character manipulation and so on. Yet before Power Apps canvas apps were introduced, I had no idea that this was a form of "declarative programming". Yet Power Apps do more than Excel - at least if your target is to build business apps rather than financial models. The #PowerFx formula language for low-code application development also supports imperative functions. A simple example is a button on a screen that you push, which then alters the state of the app (such as moving the user to a different screen). I've had the pleasure to attend many presentations by Greg Lindhorst from Microsoft on #PowerApps canvas apps in the past few years. The two key words to summarize them have always been: "THINK EXCEL". And he's right, because the key to understanding how canvas apps work is to understand the magic that goes on behind the scenes in both these apps and Excel: instant recalculation. So much of what makes these 2 tools so approachable to citizen developers who don't know traditional programming (this includes me, btw) is this recalc concept. You see the app/workbook in action right there when you change the data it references. And if you know Excel functions, many of them are exactly the same in Power Fx. Imperative logic is something we need to learn how to use alongside the declarative functions. Setting variables, changing control properties, loading/saving/patching data. Many of these can also be figured out with common sense. This table that shows the Power Fx function types side by side is really useful in understanding what you actually do in the apps you may have already built. No, I still couldn't tell by heart what functions are declarative vs. imperative. That won't stop me from building nice #lowcode apps, using what I know from Excel + a little extra Power.

  • No alternative text description for this image
Mike Guzowski

Digital Transformation Trustworthy Partner | No Code, Low Code, RPA, AI | Entrepreneur

1y

Great work! Thanks for sharing this! P.S. I understand your confusion when you say you can tell the dofference by heart. AFAIK it's hard to say whether a function is declarative vs imperative just based on its name, arguments or purpose. The real difference lays in the implementation. What you've shown in the table is the difference between operational and behavioral functions. But to be super precise the Set function is declarative, just to give one example. Generally speaking PowerFx is a declarative language. If it would be an imperative one you would set variables by writing var a = 3 instead of Set(a, 3) I have a good example to distinct imperative from declarative: IMPERATIVE goes to a restaurant and orders a 6oz. steak (cooked rare), fries (with ketchup), a side-salad (with ranch), and a Coke (with no ice). The waiter delivers exactly what he asked for, and he's charged $14.50. On the other hand, DECLARATIVE goes to a restaurant and tells the waiter that he only wants to pay around 12 dollars for dinner, and he's in the mood for steak. The waiter returns with a 6oz. steak (cooked medium), a side of mashed potatoes, steamed broccoli, a dinner roll, and a glass of water. He's charged $11.99.

Nathalie Leenders

Power Platform Consultant | MVP Business Applications | #PowerAddict | 12x Microsoft Certified

1y

Very helpful, thank you. I believe you're missing 'Print' on there, or does that qualify under a different category? 🤔

Sounds like a very nice post. We have added it to our directory. Follow our account for more information about #PowerApps#Microsoft365 content. https://www.hubsite365.com/en-de/crm-pages/power-fx--declarative---imperative-functions.htm

  • No alternative text description for this image
Like
Reply
Kody Johnston, MSN, RN, CD-P, CD-BA

Clinical Innovation + Product Strategist: Digitally transforming the healthcare industry with practical innovation, product creation, and no/low-code solutions to meet clinician, patient, and population health outcomes.

1y

Super helpful information. Thank you for sharing.

Jorge Daniel

Power Platform Solution Architect Expert

1y

Thank you for sharing.

Richard Ottley PMP, CSM, CSPO

Business/Functional Consultant, CRM & ERP Project Delivery | Microsoft Dynamics GP | Microsoft Dynamics 365, Client Engagement, Marketing/Customer Insights, Project Operations

1y

Thank you for this document Jukka. I find myself searching for functions.

Hari krishna Mallampati

Principal at Elysium Digital

1y

Love this

Rehan khan

Dynamics CRM CE | Power Apps | Integration | Azure Function

1y

Thank you for sharing this valuable information!! 🙌

Kristian Brendstrup

BizzApp Manager @ Nextagenda | Driving Business Growth

1y
See more comments

To view or add a comment, sign in

Explore topics