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?
Hi @Mikellas ,
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.
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.
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.
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
Hi @timl .Wont that just make the field not required?I feel confused. hahah
@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.
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! 🍻
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
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! 🍻
WarrenBelz
146,788
Most Valuable Professional
RandyHayes
76,287
Super User 2024 Season 1
Pstork1
66,093
Most Valuable Professional