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 / Conditional Validation...
Power Apps
Unanswered

Conditional Validation in PowerApps

(0) ShareShare
ReportReport
Posted on by 170

Hi community,

I have an edit form in my powerapp generated from a sharepoint list .Now i need to add conditions in the validation of a specific datacard (eg characters need to be more than 3) without breaking the rest of controls in Datacard.How can i achieve this please?

Categories:
I have the same question (0)
  • SpongYe Profile Picture
    5,715 Super User 2026 Season 1 on at

    @Mikellas 

     

    If() function to evaluate multiple unrelated conditions in your data card.

    If you want to validate that the text input is not blank and has more than 3 characters.

    You can use this formula in the DisplayMode property of the data card:

    If( 
     IsBlank(TextInput1.Text) || 
     Len(TextInput1.Text) < 4, 
     DisplayMode.Disabled, 
     DisplayMode.Edit
    )

     

    Disable the data card if the text input is blank or has less than 4 characters, and enable it otherwise.

     

    If you have any questions or feedback, please let me know. Have a great day! 😊

    -----------------------
    PowerYsa Power Platform Enthusiast [LinkedIn] | [Youtube]

    I love to share my knowledge and learn from others. If you find my posts helpful, please give them a thumbs up 👍 or mark them as a solution ✔️. You can also check out my [@PowerYSA] for some cool solutions and insights. Feel free to connect with me on any of the platforms above. Cheers! 🍻

  • NM-06090901-0 Profile Picture
    170 on at

    Hi Spongey and thanks for the prompt trply but i dont want to disable the card i just want it to throw the usual validation error thats the form has

  • SpongYe Profile Picture
    5,715 Super User 2026 Season 1 on at

    You could also use it for Required

    If(
     Len(TextInput1.Text) > 3, 
     true, 
     false
    )

    If you have any questions or feedback, please let me know. Have a great day! 😊

    -----------------------
    PowerYsa Power Platform Enthusiast [LinkedIn] | [Youtube]

    I love to share my knowledge and learn from others. If you find my posts helpful, please give them a thumbs up 👍 or mark them as a solution ✔️. You can also check out my [@PowerYSA] for some cool solutions and insights. Feel free to connect with me on any of the platforms above. Cheers! 🍻

  • timl Profile Picture
    36,799 Super User 2026 Season 1 on at

    @MudassarSZ365 - I'm not sure what you're using to generate these answers, but data cards do not contain a Valid property.

    @Mikellas - I would suggest that you take @SpongYe's advice here in terms of adapting the Required property to carry out this validation. 

  • NM-06090901-0 Profile Picture
    170 on at

    Hi @timl .Wont that just make the field not required?I feel confused. hahah

  • Hassan_SZ_365 Profile Picture
    542 on at

    Hi @Mikellas ,

    1. First Solution Attempt: @PowerYsa suggested using the If() function in the DisplayMode property to disable the data card if the text input was less than 4 characters. However, @Mikellas clarified that they did not want to disable the card but wanted it to show a validation error.

    2. Second Solution Attempt: MudassarSZ365 proposed using the "Valid" property in the data card, with a formula Len(DataCardValue.Text) > 3 to check if the text has more than three characters. However, this approach was later corrected by another community member, stating that data cards do not have a 'Valid' property.

    3. Third Solution Attempt: The same user, MudassarSZ365, then suggested adapting the Required property with an If statement. But @Mikellas expressed confusion about this solution, fearing it might only make the field not required rather than enforcing a character limit.

    4. Final Suggestion: @timl recommended adapting @SpongYe's initial advice to use the Required property for validation. This approach aims to validate the character count without disabling the card or breaking other controls.

    The conversation highlights the iterative process of problem-solving in community forums and the need for clear understanding of PowerApps functionalities and properties.

    Best Regards,
    Hassan Raza

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Congratulations to the March Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 502

#2
Vish WR Profile Picture

Vish WR 454

#3
WarrenBelz Profile Picture

WarrenBelz 416 Most Valuable Professional

Last 30 days Overall leaderboard