Data Bear

Power Apps Formula Tutorial: Master FORALL, WITH & ISMATCH

Power BI Sharing

If you’re working with Canvas apps and want to level up your development skills, this Power Apps formula tutorial is for you. We’ll explore three essential formulas FORALL, WITH, and ISMATCH that enhance app performance, reduce complexity, and ensure clean, validated inputs.

Whether you’re optimizing batch updates or validating form data, these Power Apps techniques will streamline your app-building process.

1. FORALL Efficient Batch Record Updates

The FORALL function is a must-know in any Power Apps formula tutorial. It’s perfect for applying logic across collections and performing multiple patches in a single step.

Example Use Case

You have a collection with initial values and want to multiply each by a custom input and patch the result. With FORALL, you can iterate through each item and update it efficiently.

Key Benefits in Power Apps:
  • Great for batch updates

  • Simplifies looping logic

  • Improves data processing performance

Including FORALL in your Power Apps formula tutorial toolkit ensures your apps handle multiple records seamlessly.

 Formula Breakdown:
ForAll(
    CollectionName As record,
    Patch(
        CollectionName,
        record,
        { CalculatedValue: record.InitialValue * Multiplier }
    )
)

Using As in the loop helps define a temporary name to avoid conflicts, especially useful in nested or complex data manipulations.FORALL Efficient Batch Record Updates Power Apps formula tutorial

2. WITH Scoping Without Variables

No Power Apps formula tutorial is complete without the WITH function. It lets you calculate values in a defined scope without cluttering your app with extra variables.

Use Case:

Imagine comparing two loan scenarios. Instead of using separate variables for each interest rate, loan amount, and term, use WITH to localize the calculation making your formulas more readable and reducing memory overhead.

Why It’s Important:
  • Keeps logic contained

  • Avoids global variable conflicts

  • Ideal for nested calculations

This tutorial shows how WITH simplifies app logic, especially when comparing or calculating multiple inputs.

 Nested WITH Example:
With({ Rate1: SliderRate1.Value / 100, Amount1: SliderAmount1.Value, Years1: SliderYears1.Value },
    With({ R: Rate1 / 12, P: Amount1 * 10000, N: Years1 * 12 },
        Text( P * R / (1 - Power(1 + R, -N)), "[$-en-US]$#,###.00")
    )
)Power Apps formula tutorial
3. ISMATCH Advanced Input Validation

Validation is essential in every app and ISMATCH is the go-to formula for it. This Power Apps formula tutorial demonstrates how to use regular expressions to validate email formats, enforce alphanumeric input, and restrict characters to only letters.

Examples Covered:
  • Email validation using built-in regex

  • Alphanumeric restriction with ^[A-Za-z0-9]{1,100}$

  • Letter-only validation with 8–20 character limit using ^[A-Za-z]{8,20}$

Why ISMATCH Matters:
  • Keeps data clean at the source

  • Prevents invalid entries

  • Easily integrates with user feedback mechanisms

Add ISMATCH to your Power Apps toolkit to tighten input controls and enhance user experience.

Sample Regex Validations:
Purpose Regex Pattern
Email EmailRegex (built-in)
Alphanumeric (1–100 characters) "^[A-Za-z0-9]{1,100}$"
Letters only (8–20 characters) "^[A-Za-z]{8,20}$"
 Formula Example:
IsMatch(TextInput.Text, "^[A-Za-z0-9]{1,100}$")

You can combine ISMATCH with visual feedback (e.g., changing the border color of inputs) to improve user experience and data cleanliness.ISMATCH Advanced Input Validation Power Apps formula tutorial

Conclusion

Mastering these three functions FORALL, WITH, and ISMATCH will greatly improve your Power Apps performance and maintain clean, validated data inputs. Use FORALL for efficient data updates, WITH for scoped calculations, and ISMATCH for bulletproof input validation.

This Power Apps formula tutorial is just the beginning. These tools not only make your apps run smoother but also help you build cleaner, more maintainable solutions.

Learn More

Looking to sharpen your Power BI and Power Platform skills even further?
Check out our expert-led Power BI Training Courses