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

Conditional Validation in PowerApps

(0) ShareShare
ReportReport
Posted on by 168

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,616 Super User 2025 Season 2 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
    168 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,616 Super User 2025 Season 2 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,415 Super User 2025 Season 2 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
    168 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

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 739 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 343 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard