Power Fx Archives - Microsoft Power Platform Blog Innovate with Business Apps Thu, 16 Jan 2025 18:52:36 +0000 en-US hourly 1 User defined functions, user defined types, and enhanced component properties move forward http://approjects.co.za/?big=en-us/power-platform/blog/power-apps/user-defined-functions-user-defined-types-and-enhanced-component-properties-move-forward/ http://approjects.co.za/?big=en-us/power-platform/blog/power-apps/user-defined-functions-user-defined-types-and-enhanced-component-properties-move-forward/#respond Thu, 16 Jan 2025 18:52:35 +0000 More Power Fx formula reuse! User defined functions can now call behavior functions with side effects and be chained. User defined types enable passing records and tables in and out of user defined functions and can type JSON and untyped objects. And enhanced component properties move to preview.

The post User defined functions, user defined types, and enhanced component properties move forward appeared first on Microsoft Power Platform Blog.

]]>
I’m pleased to announce updates that will make Power Fx formula reuse and maintenance easier than ever:

  • User defined functions (UDFs) can now include behavior functions with side effects, such as Set, Collect, Reset, and Notify. Declarative is always best, so use this facility only when you must. When you do, wrap the formula in { } and you can then use the ; (or ;;) chaining operator.
  • User defined types (UDTs) enable tables and records to be passed in and out of UDFs. UDTs also enable bulk conversion of JSON untyped objects to typed objects, particularly useful with web APIs. Welcome the new Type and RecordOf functions, an expanded role for the AsType and IsType functions, and a new parameter for ParseJSON.
  • Enhanced component properties (ECPs) have moved to preview. With any remaining feedback, we plan to take them to general availability in the next few months. ECPs enable the ability to share logic across apps through a component library.

This is the last major update to UDFs planned before we start down the road to general availability. UDTs will be on the same timeline. Now is the time to take this functionality through its final paces and provide feedback before the design is locked; please leave feedback in the community experimental features forum. Both features are experimental and require turning on these switches in Settings > Updates > Experimental:

A screenshot of a computer

Behavior UDFs

Named formulas depend on being declarative, something the system can defer and recalc based on changes in the app. They can’t have side effects, such as incrementing a variable, or this wouldn’t be possible. UDFs to date have built on top of named formulas by adding parameters, but still had to be declarative.

Obviously, that is limiting for an app. We need buttons, buttons that do important things like updating a database. We’d like to be able to put that logic in a UDF too. And now you can, by wrapping the UDF in curly braces:

CountUp( increment : Number ) : Void = {
    Set( x, x+increment );
    Notify( $"Count: {x}" );
};

This simple example will increment the global variable x and display a notification with the result each time CountUp(1) is called from, say, the OnSelect formula of a Button control.

This is a huge step for reuse and manageability. Now you can extract and parameterize your action logic and reuse it throughout your app, having only one source of truth for that logic that is easier to maintain.

For more information and examples, see Behavior user defined functions.

User Defined Types

User defined types enable UDFs to take in and return records and tables. Until now, UDFs were limited to scalar data types, such as Number, Text, DateTime, etc.

The new Type function is the key. Use it to define a named formula for a type, using the same syntax you would use for a literal record or table value. For example, imagine you had a table of paper sizes:

PaperSizes =
[ { Name: "A4", Width: 210, Height: 297 },
  { Name: "Letter", Width: 216, Height: 279 },
  { Name: "Legal", Width: 216, Height: 356 } ];

We can define types for a single paper as a special kind of named formula that uses the := assignment operator and Type function. The syntax used within the Type function is the same as the literal record values in the PaperSizes definition, with specific values replaced by their data type names:

PaperType := Type( { Name: Text, Width: Number, Height: Number } );

We can now use this type to pass a single paper size into a UDF:

PaperArea( Paper: PaperType ): Number = Paper.Width * Paper.Height;

And we can call our UDF with:

PaperArea( First( PaperSizes ) ) // returns the number 62370

We can define a type for a table, matching the type of PaperSizes:

MultiPaperType := Type( [ PaperType ] );

And then define a function to filter a table of paper sizes:

LargePaperSizes( Papers: MultiPaperType ) : MultiPaperType =
    Filter( Papers, PaperArea( ThisRecord ) > 70000

And then we can call it with:

LargePaperSizes( PaperSizes )
// returns [ { Name: "Legal", Width: 216, Height: 356 } ]

For more information and examples, see User defined types.

JSON and Untyped ❤️ UDTs

UDTs are great for UDFs. But they have another great use case: converting an untyped object to a typed object. Imagine that JSON was returned from a web API for another set of paper sizes:

MorePaperSizes =
"[ { ""Name"": ""A0"", ""Width"": 841, ""Height"": 1189 },
{ ""Name"": ""A6"", ""Width"": 105, ""Height"": 148 } ]";

You probably know that you can use the ParseJSON function to convert this to an Untyped object.

MoreUntyped = ParseJSON( MorePaperSizes )

From which you can extract individual elements from the JSON by casting them explicitly or implicitly at the point of use. But since the structure is untyped and potentially heterogenous, it cannot be used with functions such as AddColumns which requires a homogenous Power Fx table:

AddColumns( MoreUntyped, InStock, true ) // error

With UDTs, we can now convert this JSON directly to a Power Fx typed object by providing the type as the second parameter to ParseJSON:

MoreTyped = ParseJSON( MorePaperSizes, MultiPaperType )

And now we can add a column:

AddColumns( MoreTyped, InStock, true ) // OK

The IsType and AsType functions have also been overloaded to take an untyped object and type arguments. Web APIs that return an untyped object can now be easily converted to a typed object.

Feedback, please!

These are experimental features, and for good reason, we are still making changes. There are a lot of nuanced details with UDFs and UDTs we want to make sure we get right. We’d love to hear your feedback on how it works, please let us know in the community experimental features forum.

The post User defined functions, user defined types, and enhanced component properties move forward appeared first on Microsoft Power Platform Blog.

]]>
http://approjects.co.za/?big=en-us/power-platform/blog/power-apps/user-defined-functions-user-defined-types-and-enhanced-component-properties-move-forward/feed/ 0
Creating and explaining formulas with Copilot now even easier http://approjects.co.za/?big=en-us/power-platform/blog/power-apps/creating-and-explaining-formulas-with-copilot-now-even-easier/ Tue, 12 Nov 2024 21:55:55 +0000 Power Apps introduces the new 'Create a Formula' feature, making it easier than ever to build and edit Power Fx formulas. Plus, now you can explain partial formulas too!

The post Creating and explaining formulas with Copilot now even easier appeared first on Microsoft Power Platform Blog.

]]>
We are excited to announce the launch of the new “Create a formula” preview feature in Power Apps, designed to make building and editing Power Fx formulas easier and more intuitive than ever before.

Copilot can now also explain partial formulas, which is especially useful for longer formulas where you need an explanation on a specific part of the code.

And to top it off, Copilot in the formula bar will now support more languages, enabling most of our worldwide makers to take advantage of these powerful features.

Create a formula with ease

With the new “Create a Formula” feature, you can now generate Power Fx formulas directly from natural language. Simply select the Copilot button, ask it to create a formula, type your desired action in plain language, and the AI will suggest the appropriate formula and append it wherever the cursor was located when the request was made after you click apply.

This functionality is perfect for both seasoned developers and those new to Power Apps, providing a seamless experience for all users. Remember, formulas are specific to the control and property that is selected, and some actions require working across controls and properties.

Animated Gif Image

Additionally, the maker can use the thumb up/down icons to provide feedback that will help to make the product and AI interactions better over time. By sharing the prompt and response along with your feedback, it helps us understand what we can do to improve.

To enable the Create a Formula Capability, turn on the “Copilot for formulas” flag in Canvas App Settings > Updates > Preview.

Explain a partial formula

In addition to creating formulas, we’ve expanded our formula explanation capability to include the ability to explain a partial formula.

By selecting a formula before clicking the Copilot icon, instead of the “Explain this formula” option, you have the option to “Explain this selection” and get a plain language explanation of what the selected portion of the formula does.

The selection does not have to be precise either, as the Copilot knows when to include context surrounding the selection in order to provide an explanation. This is particularly useful for understanding long or complex formulas that benefit from a more granular explanation.

Animated Gif Image

Worldwide expansion

Copilot support in the formula bar now supports 18 languages. To find out if your language is supported, or to learn more, take a look at the product documentation.

Let us know

We hope you find these new features as exciting and useful as we do. We look forward to hearing your feedback and seeing the innovative ways you use them in your apps. Stay tuned for more updates and enhancements in Power Apps!

The post Creating and explaining formulas with Copilot now even easier appeared first on Microsoft Power Platform Blog.

]]>
Call SQL Server procedures directly in Power Fx (GA) http://approjects.co.za/?big=en-us/power-platform/blog/power-apps/call-sql-server-procedures-directly-in-power-fx-ga/ Wed, 31 Jul 2024 14:00:00 +0000 GA of calling stored procedures directly in Power Fx. Speed up app development. Speeds up Power App performance.

The post Call SQL Server procedures directly in Power Fx (GA) appeared first on Microsoft Power Platform Blog.

]]>
We are excited to announce that calling SQL Server stored procedures in Power Fx is now generally available in all regions. You do not need to call a Power Automate Flow to use a stored procedure making development of Power Apps for SQL easier for authors and faster overall performance for both authors and end users. The ability to call stored procedures for the SQL connector directly is an extension to the existing tabular model and gives users access to tables, views, and stored procedures. This feature extends our ongoing support of SQL Server as a primary development target for Power Apps.

Getting started

To use this feature, you need to either create a new SQL connection to your app or already have one in your app. In the table selector, choose the ‘Stored Procedure’ tab and select all of the stored procedures you want to access in your app. Then you can directly access the stored procedure in your app by referring to the data source name and then ‘dot’ into the specific stored procedure in a Power Fx formula.

This feature is an extension to the tabular model. We allow the ability to execute stored procedures, but we do not allow the ability to run arbitrary SQL. This helps provides an additional level of security. Additionally, you can bind a stored procedure directly to a gallery or table by checking the ‘Safe to use for galleries and tables’ checkbox.   

See the article Connect to SQL Server from Power Apps for a discussion of how and when to select this option and other details on how to use this feature.

The post Call SQL Server procedures directly in Power Fx (GA) appeared first on Microsoft Power Platform Blog.

]]>
New Analysis Engine Now Generally Available!  http://approjects.co.za/?big=en-us/power-platform/blog/power-apps/new-analysis-engine-now-generally-available/ Thu, 25 Jul 2024 13:00:00 +0000 We’re thrilled to announce that the New Analysis Engine is now generally available (GA)! If you are facing performance issues in loading or editing a canvas app, consider enabling the New Analysis Engine setting.

The post New Analysis Engine Now Generally Available!  appeared first on Microsoft Power Platform Blog.

]]>
We’re thrilled to announce that the New Analysis Engine is now generally available (GA)! This major milestone is all thanks to the feedback from our early adopters and app makers during the experimental and preview stages. 

Animated Gif Image
App load time for a sample app, with the new analysis engine (top) and existing analysis engine (bottom)

An improved static analysis made this speed up possible

While you edit or play your app in Studio, a continuous analysis of app elements and their interactions is happening in the background. This lets Studio determine the types of all the variables and collections in your app, maintain a real time dependency graph of relationships between different expressions, and keep track of what columns your app uses from every data source. For example, this allows us to know that if you change an expression `Set(x, 5)` to `Set(x, {Lorem: “Ipsum”})` that the type of `x` is now a record instead of a number, and any references in your app to `x + 1` will therefore be marked as erroneous.  

What’s New? 

  • Performance Boost: The New Analysis Engine optimizes how we approach that analysis, ensuring that we can get it started faster when you load your app in Studio, and that we keep things up to date quicker while you edit. The new analysis algorithm scales linearly with app size, eliminating complex cases that previously caused performance issues. Complex Canvas apps that previously took minutes to load should now load much faster. 

    While this performance boost will be most noticeable for the largest apps that you build, we see improvements across the board when switching to the New Analysis Engine.

    Note: These improvements have no impact on app run time performance of a published app.

    Here are some statistics from real apps showcasing the performance improvement on app load for existing analysis and new analysis: 
  • Accuracy: The New Analysis Engine is not only faster but also more accurate. It enables more accurate determination of variable and collection types. When analyzing field usage (Explicit Column Selection), the New Analysis Engine reliably identifies the columns used in your app, addressing several long-standing bugs and enhancing Data Source call performance in published apps. Additionally, it facilitated the development of the User Defined Functions feature, which would not have been feasible with the previous engine.
  • Preview No More: Thanks to your valuable feedback during the experimental and preview phases, we’ve fine-tuned the engine. It’s now ready for prime time!

What You Need to Do 

  • New Apps: For all new apps you create, the New Analysis Engine will be turned on by default. Enjoy the improved performance right from the start! 
  • Existing Apps: If you have existing apps, we recommend enabling the New Analysis Engine. Here’s how:
    • Open your app in Studio. 
    • Go to Settings. 
    • Go to Updates. 
    • Look for the “New Analysis Engine” toggle on the New tab. 
    • Turn it on. 
    • Test your app thoroughly to ensure everything works as expected. 

Important Note: Starting February 2025, all Canvas apps will be migrated to use new analysis engine. We recommend testing your canvas apps with the New Analysis Engine to ensure they function as expected prior to migration.

A Word of Caution

While we’re confident in the New Analysis Engine’s capabilities, please refrain from using it for existing apps in production environments until you’ve thoroughly tested your app. Subtle behavior differences may arise, and we appreciate your vigilance. 

Your Feedback Matters

JOIN the discussion

Go to community forum

As always, your feedback is invaluable. Let us know how the New Analysis Engine performs for you. Share your experiences, report any issues, and help us fine-tune this feature further on the community forum

Thank you for being part of our Canvas app community! Together, we’re making app development smoother, faster, and more delightful.

Happy app building! 

The post New Analysis Engine Now Generally Available!  appeared first on Microsoft Power Platform Blog.

]]>
Introducing Code View in Power Apps Studio (Public Preview) http://approjects.co.za/?big=en-us/power-platform/blog/power-apps/introducing-code-view-in-power-apps-studio-public-preview/ Wed, 29 May 2024 16:12:00 +0000 The goal of fusion development is to create an environment where Citizen Developers, Professional developers (aka code-first) and IT Professional can collaborate seamlessly. We want to create great experience for makers creating an app for the first time and for code-first developers that want to have the transparency of the source code for their Power Apps. We

The post Introducing Code View in Power Apps Studio (Public Preview) appeared first on Microsoft Power Platform Blog.

]]>
The goal of fusion development is to create an environment where Citizen Developers, Professional developers (aka code-first) and IT Professional can collaborate seamlessly. We want to create great experience for makers creating an app for the first time and for code-first developers that want to have the transparency of the source code for their Power Apps.

We are proud to announce the public preview of a Code View in Power Apps Studio.

Developers can now view and use the source code, in readable YAML + Power Fx format.

Power Apps Code View

You can select any screen or specific control and visualize the underlying code.

Copy and paste with YAML code

Having the source code available will also allow new experiences. Developers can now copy any control in a code format. You can copy any visual control within Studio as a YAML Code.

With the copy from Power Apps Studio, you can paste it to a text or to a code editor like Visual Studio Code to do small edits. Once you are done, you can paste it back to Power Apps Studio to create a new control.

You can share code snippets over Instant Message (like Microsoft Teams), email, post the code on a blog, use it to ask or answer questions in a forum or community.

What is next?

Code view and copying and pasting with code is available in Preview today.

The copy used in this sample is below. Try to paste it to you Power App now!

- Header1:
   Control: Header
   Properties:
      IsLogoVisible: =false
      Title: =$"Welcome to Code View, {User().FullName}"

This is just the first step to create more experiences for code-first developers in Power Apps Studio. We’ll support editing directly in the Studio soon as well, keep an eye out. Your code is also going to be available natively to your source code solutions, giving you transparency around changes like any other software project.

More content from Microsoft Build 2024

Using Power Platform to accelerate full-stack software development – To learn more about Code first development with Power Platform.

Enable every developer to collaborate with low code + pro code – To learn more about Low code and Pro code collaboration.

The post Introducing Code View in Power Apps Studio (Public Preview) appeared first on Microsoft Power Platform Blog.

]]>
Infuse any AI solution with your enterprise data, prompts and plugins http://approjects.co.za/?big=en-us/power-platform/blog/power-apps/infuse-any-ai-solution-with-your-enterprise-data-prompts-and-plugins/ Tue, 14 May 2024 20:42:36 +0000 AI models are improving rapidly, and customers need effective tools to integrate AI into their business solutions that provide precise, reliable and consistent information, and are easy to deploy. Today we are happy to announce our latest improvements to help makers integrate AI into their low-code apps and solutions. Now available as Public Preview in Microsoft Copilot Studio, data grounding with Dataverse tables allows makers to create powerful AI prompts that are grounded with their enterprise data while enforcing real time enterprise security. Additionally, we are excited to announce that low-code plugins now support five new AI Power Fx functions, and share  how Capgemini New Zealand, a global leader in consulting, technology services and digital transformation, is leveraging these new capabilities to create value for their clients and solve business problems faster than ever before.

The post Infuse any AI solution with your enterprise data, prompts and plugins appeared first on Microsoft Power Platform Blog.

]]>
AI models are improving rapidly, and customers need effective tools to integrate AI into their business solutions that provide precise, reliable and consistent information, and are easy to deploy. Today we are happy to announce our latest improvements to help makers integrate AI into their low-code apps and solutions. Now available as Public Preview in Microsoft Copilot Studio, data grounding with Dataverse tables allows makers to create powerful AI prompts that are grounded with their enterprise data while enforcing real time enterprise security. Additionally, we are excited to announce that low-code plugins now support five new AI Power Fx functions, and share how Capgemini New Zealand, a global leader in consulting, technology services and digital transformation, is leveraging these new capabilities to create value for their clients and solve business problems faster than ever before.

Improve AI generated responses by grounding prompts with your enterprise data tables, now in Public Preview

As companies are rapidly adopting Copilot and conversational AI tools, they are increasingly introducing prompts as a foundational element to integrate generative AI capabilities within Microsoft Power Platform solutions, including Power Apps, Power Automate, and Copilot Studio. With Prompt Builder, already generally available, anyone can use natural language to instruct the GPT model to behave in a certain way or to perform a specific task. Typical scenarios include the ability to generate content analysis, summarize, classify, extract or transform information data.

Today, we are excited to announce the public preview of data grounding with Dataverse tables for Prompt Builder in Microsoft Copilot Studio, a new capability that helps makers create reliable and efficient AI solutions at enterprise scale.  With data grounding, customers can add a dynamic knowledge source to their prompts, using the model of Retrieval Augmented Generation (RAG), to enhance the underlying AI model’s capabilities from being a general-purpose model to an enterprise specific tool that operates within the business context of an enterprise customer.

Selecting Dataverse Tables when grounding data for your prompt.
Learn more about prompt builder:

Infuse AI into your application’s business logic with AI-powered low-code plugins

Low-code plugins enable any maker to build complex AI-powered solutions in the Power Platform using the PowerFx expression language.  Capgemini New Zealand, A global leader in consulting, technology services and digital transformation, saw the potential of low-code plugins from their announcement at Microsoft Build 2023 and quickly began upskilling on them in their local Dynamics 365/Power Platform practice. Low-code plugins provide the ability to create real-time, secure and scalable business logic for their customers, all without the underlying cost and added infrastructure of writing traditional code. As a result, Capgemini NZ can create value for their clients, solving their business challenges faster than ever before.

I’m particularly excited by the integration potential with Copilot Studio. Our clients are asking us to help them apply generative AI to their business challenges. Low-code plugins fill a crucial gap of automating business logic between the large language model in Copilot and the client’s underlying data. As such we’ve been showcasing our learnings from low-code tools such as low-code plugins in our regular internal Communities of Practice so that we’re ready to hit the ground running when this feature is generally available.
-Richard Anness, Power Platform Practice Lead, Capgemini NZ 
With low-code plugins now available in Microsoft Copilot Studio, customers can embed advanced business logic into their Copilots and AI-powered applications including triggering workflows & data updates within business processes modeled within Microsoft Dataverse. In addition to the existing set of supported Power Fx operators, variables and formulas, we are also excited to introduce low-code plugin support for 5 new Power Fx AI functions:

  • AIReply: Drafts replies to messages (e.g., customer reviews of a product).
  • AISummarize: Summarizes text (e.g., email messages or document content).
  • AISentiment: Detects sentiment (positive, negative, neutral) in text (e.g., customer reviews).
  • AIClassify: Classifies text into predefined categories (e.g., Problem, Billing, How To, Licensing).
  • AITranslate: Translates text from one language to another (source language is automatically detected).

After the development of low-code solutions using low-code plugins, monitoring their execution becomes an integral part of maintaining a high-quality, reliable, and performant solution. It empowers developers and administrators with the insights needed to ensure the best possible experience for end-users. We are delighted to announce that we are now enabling the preview of the new plugin monitoring report  inside Dataverse Accelerator with two key capabilities:

  • Centralized log viewer: Access and view trace logs from Dataverse Custom APIs, low-code plugins, and pro-code plugin executions in an environment from one central location.
  • Filtering capabilities: Conveniently filter log history to quickly find logs relevant to debugging needs.

For more information on how to try out low-code plugins:

The post Infuse any AI solution with your enterprise data, prompts and plugins appeared first on Microsoft Power Platform Blog.

]]>
Introducing new Copilot features for Power Fx http://approjects.co.za/?big=en-us/power-platform/blog/power-apps/introducing-the-new-copilot-features-for-power-fx/ Mon, 29 Apr 2024 19:14:22 +0000 Discover how Copilot, a feature in Power Apps, can help you create and understand formulas in Power Fx, improving productivity, enhancing collaboration, and reducing errors when building apps.

The post Introducing new Copilot features for Power Fx appeared first on Microsoft Power Platform Blog.

]]>
Power Apps, a powerful low-code platform from Microsoft, empowers users to create custom applications without extensive coding knowledge. One of the key features in Power Apps is Power Fx, a formula language designed for building rich apps. While Power Fx is a powerful tool, users often face challenges such as complexity, error handling, and lack of natural language explanation. To address these challenges, we are excited to announce the release of two new Copilot features: Explaining a Formula and Generating Power Fx from Natural Language.

Explaining a Formula

Copilot’s “Explaining a Formula” feature bridges the gap between technical and non-technical audiences. By providing a human-readable description of the Power Fx code, users can easily communicate the purpose and functionality of their formulas. This feature is especially helpful when someone is first opening an app they are not familiar with, as it allows them to quickly get up to speed on the app’s logic and functionality, regardless of their technical background. For example:

Original formula:

Filter(Orders, Status = "Shipped" && TotalAmount > 1000)

 

Explained in natural language:

“Retrieve orders that have been shipped and have a total amount greater than $1000.”

 

Explain this Power Fx formula demo

Note: Explaining a Formula is being released to General Availability in English only, with plans to quickly follow with support in other languages.
Generating Power Fx from Natural Language

Copilot is getting another feature that lets users write formulas with natural language comments. The user just writes what they want, and Copilot creates the Power Fx code for them. This feature uses an existing option in the formula bar, where users can write code comments with // syntax. To get the Power Fx suggestion from the comment, the user types // followed by their comment, waits a bit, and sees the suggestion. The user can press tab to use the suggestion or type over it to change it. If there is no suggestion, the model couldn’t make a valid function from the comment, and the user can try a different comment. This feature not only simplifies formula creation but also reduces the risk of syntax errors. For Instance:

Natural language comment:

“// Calculate the average revenue per customer.”

 

Generated Power Fx:

Average(Orders, TotalRevenue / CountRows(Customers))

 

Generating Power Fx from a code comment demo

Note: Comment generated Power Fx is being released as a preview feature with English only support, and the rollout will be gradual as capacity becomes available. This means that some users will be able to try out the feature and provide feedback, while the team works on ensuring there is a positive user experience for our global footprint of Power Apps makers.
Improvement to Inline Copilot Functionality

As an added bonus, the new advanced models powering formula explanations and authoring can also speed up the Formula authoring experience for select controls by triggering the Copilot button in the inline action bar. The Copilot generates formulas for supported controls (Gallery, Data table, Text box, Drop down, Combo box, and Text label) in the Ideas panel and can be modified based on the instructions you provide.

To add a formula, select the control and click on Copilot icon.

Inline Action Bar Copilot Button demo
Note: This feature was previously available as Power Apps Ideas, and is still in preview. Preview features can be managed in the Power Platform admin center.
Benefits of Using Copilot Features

By leveraging these new Copilot features, users can improve their productivity, enhance collaboration, and reduce errors. Copilot accelerates formula development by providing instant explanations and generating code from plain language. With natural language descriptions, users can collaborate seamlessly with business stakeholders, ensuring everyone understands the app’s logic. Copilot’s error highlighting and clear explanations help users catch mistakes early, leading to more reliable formulas.

Overall, the new Copilot features for Power Fx empower users to create robust apps efficiently. Whether you’re a seasoned developer or a citizen developer, leveraging these capabilities will enhance your Power Apps experience. We value your feedback and would love to hear your thoughts on these new features. To share your experience and provide suggestions, please visit this post on the Power Apps community forum. Your feedback will help us continue to improve and enhance the Power Apps experience for all users. Happy building!

See additional feature documentation on Microsoft Learn

 

 

 

The post Introducing new Copilot features for Power Fx appeared first on Microsoft Power Platform Blog.

]]>
Power Fx: Column names escape double quotes http://approjects.co.za/?big=en-us/power-platform/blog/power-apps/power-fx-no-more-columns-names-in-text-strings/ Wed, 10 Apr 2024 09:00:20 +0000 We are making a small syntax change to how column names are specified in AddColumns, DropColumns, ShowColumns, RenameColumns, Search, GroupBy, Ungroup, and DataSourceInfo functions.  Today they need to be wrapped in double quotes as a text string, but tomorrow they will not.  We will automatically update the syntax in existing apps to reflect the new syntax.  The change makes these functions consistent with other uses of column names, easier to use by no longer requiring logical names, and consistent with other Power Fx 1.0 hosts such as Copilot Studio, Power Automate Desktop, and Cards that have been using this new syntax for the last year.

The post Power Fx: Column names escape double quotes appeared first on Microsoft Power Platform Blog.

]]>
With Studio version 3.24042, rolling out to Preview this week, we are making a small syntax change to how column names are specified in some function arguments.  Today they need to be wrapped in double quotes as a text string, but tomorrow they will not.  The functionality of these functions is not changing in any way.  We will automatically update the syntax in existing apps to reflect the new syntax – all existing apps will continue to operate as they do today.  The change makes these functions consistent with other uses of column names, easier to use by no longer requiring logical names, and consistent with other Power Fx 1.0 hosts such as Copilot Studio, Power Automate Desktop, and Cards that have been using this new syntax for the last year.

The impacted functions are:

For example, today, this formula adds a Miles column to a table, calculated from the Kilometers column:

AddColumns( Distances, "Miles", Kilometers * 0.6214 )

Tomorrow, write the formula with the new column name just as you would an existing column of the table, without double quotes:

AddColumns( Distances, Miles, Kilometers * 0.6214 )

It’s a subtle, but important difference.  The use of a text string gave the impression that this name could be dynamic when it could not which led to maker confusion.  It was inconsistent with other places where columns are used and defined, such as in the calculation at the end of the formula above and in a record definition.

This change also enables you to use display names.  If the Contacts table is in Dataverse, you would have previously needed to use logical names to reference the columns:

Search( Contacts, TextInput1.Text, "cr43e_firstname", "cr43e_lastname" )

No longer, this can now be written much more elegantly as:

Search( Contacts, TextInput1.Text, 'First Name', 'Last Name' )

As shown here, use single quotes to insert a space or other special character in the name, as you would with variable names.

But wait… Aren’t we going to break all the existing apps in the world?  Power Apps has a mechanism to update app formulas automatically.  This change is only a syntax change, the behavior of these functions does not change, making it perfect to use this mechanism.  Your apps will be automatically updated to the new syntax when they are loaded into Studio at or after version 3.24042. In general, you don’t need to do anything except to start using the new syntax for new formulas.

This is a part of Power Apps moving to Power Fx 1.0 that we could do without needing a feature switch. There are two more functions, SortByColumns and Validate that will be getting similar treatment, but since those could introduce a breaking change we decided to do that under the upcoming Power Fx 1.0 compatibility switch.

More examples:

DropColumns( Distances, "Kilometers" )                          // before
DropColumns( Distances, Kilometers )                            // after
RenameColumns( Distances, "Kilometers", "Km" )                  // before
RenameColumns( Distances, Kilometers, Km )                      // after
ShowColumns( Distances, "Kilometers" )                          // before
ShowColumns( Distances, Kilometers)                             // after
GroupBy( Sales, "State", "Remainder" )                          // before
GroupBy( Sales, State, Remainder )                              // after
Ungroup( GroupedSales, "Remainder" )                            // before
Ungroup( GroupedSales, Remainder )                              // after
DataSourceInfo( IceCream, DataSourceInfo.Required, "Flavor" )   // before
DataSourceInfo( IceCream, DataSourceInfo.Required, Flavor )     // after

If you have any concerns or questions, please leave them in the comments for this blog post.  Thanks!

The post Power Fx: Column names escape double quotes appeared first on Microsoft Power Platform Blog.

]]>
Call SQL Server stored procedures directly in Power Fx (Preview) http://approjects.co.za/?big=en-us/power-platform/blog/power-apps/call-sql-server-stored-procedures-directly-in-power-fx-preview/ Thu, 29 Feb 2024 18:30:45 +0000 Calling stored procedures directly in Power Fx. Speed up app development. Speeds up Power App performance.

The post Call SQL Server stored procedures directly in Power Fx (Preview) appeared first on Microsoft Power Platform Blog.

]]>
We are excited to announce that you can now directly call SQL Server stored procedures in Power Fx.  You no longer need to call a Power Automate Flow to use a stored procedure. This feature is in preview and currently in all regions.  This makes development of Power Apps for SQL much easier. And your apps will be faster.  The ability to call stored procedures for the SQL connector directly is an extension to the existing tabular model and gives users access to tables, views, and stored procedures. This feature extends our ongoing support of SQL Server as a primary development target for Power Apps.

SQL table selector with tables / views and also stored procedures.

Getting started

To use this feature, open a Power App and enable the preview switch in ‘Settings / Upcoming features / Preview’.  Then, create a new SQL connection to your app. You can add to the existing connector already present in the app. In the table selector, choose the ‘Stored Procedure’ tab and select all of the stored procedures you want to access in your app. Then you can directly access the stored procedure in your app.

Formula calling a stored procedure directly. Prefix the stored procedure with the name of the connector.

This feature is an extension to the tabular model. We allow the ability to execute stored procedures, but we do not allow the ability to run arbitrary SQL. This helps provides an additional level of security. Additionally, you can bind a stored procedure directly to a gallery or table by choose the ‘Safe to use for galleries and tables’ checkbox.   See the article Connect to SQL Server from Power Apps for a discussion of how and when to select this option and other details on how to use this feature.

 

 

 

The post Call SQL Server stored procedures directly in Power Fx (Preview) appeared first on Microsoft Power Platform Blog.

]]>
January 2024 updates for modernization and theming in Power Apps http://approjects.co.za/?big=en-us/power-platform/blog/power-apps/january-2024-updates-for-modernization-and-theming-in-power-apps/ Mon, 05 Feb 2024 18:19:07 +0000 na

The post January 2024 updates for modernization and theming in Power Apps appeared first on Microsoft Power Platform Blog.

]]>
Note: This blog is in continuation of the series of modern controls coming to canvas apps. We provided updates for November and December in the 2023 recap of modern controls. 

Modern controls updates in canvas apps

We continued enhancing modern controls and theming and delivered some key enhancements, which are rolling out to our customers at the time of publish. Below are the updates made to controls and theming in the last month: 

  1. Date picker – We fixed issues around different date formats. Makers can now also set a minimum and maximum dates instead of just setting minimum and maximum years. 
    Date formats

  2. Table control Users can now easily sort the data in the Table by using dropdowns from the column headers for supported data types. You can enable it using “EnableSorting” property.
    Sort values in table control

  3. Base palette color – A new visualization for picking color palettes has been added to reinforce to makers that they are picking a set of colors to be applied to the control holistically, and not a single color.
    Updated flyout for color picker on base palette color property

Upcoming enhancements to modern controls and theming: 

We are currently working on a few exciting updates that will be released in next few weeks: 

  • New controls
    1. Number input Makers can add a number input control that can be used to type in or use the arrows to select a number value. They can also configure decimal precision and step values for this control.

      Number input control
    2. Icon control Makers will be able to add standalone icons. Makers will also be able to add an icon on the button. Makers will be able to change the icon style to outline or filled. Makers are also able to customize the color of the icons.   
      Fluent icons in different color
    3. Stream control – Stream (on SharePoint) is an intelligent video experience that empowers you to record, upload, discover, share, and manage video just as you would any other file. Power Apps will soon publish a control for makers to configure a stream video to play in Power Apps. This is also the replacement of control for Stream (Classic) as the classic stream service is on path to deprecation in April.
  • Updates on the Table control: We will soon be exposing an OnSelect event for the Table that will trigger when a row is selected. In addition, we are working on allowing makers to make customizations at the column level, including the width and header text of individual columns.
  • Collapsible sections in the properties pane: We are making improvements to the properties pane for modern controls to re-organize properties into collapsible sections. This will make app building easier for makers since there will be more consistency in the location of properties across modern controls and makers can collapse sections of properties, they are not interested in.
    Collapsible properties
  • Simple in-app custom theming: We are working on the first iteration of custom theming, which will allow a maker to pick a seed color and font for a custom theme.
Thank you to our community and makers for continuing to provide us feedback!! This feedback is incredibly valuable and helpful in guiding improvements to modern controls and theming capabilities. 

The post January 2024 updates for modernization and theming in Power Apps appeared first on Microsoft Power Platform Blog.

]]>