Forum Discussion
Item validation based on 2 columns
philipp777 You have two options to check the same data is already available in list or not:
- Just before submitting the list form - if you have any button for submit, use "OnSelect" property of button to add formula & logic.
- "OnChange" property of individual field control in form.
Please click Mark as Best Response & Like if my post helped you to solve your issue. This will help others to find the correct solution easily. It also closes the item. If the post was useful in other ways, please consider giving it Like.
- philipp777Aug 02, 2022Copper Contributor
Thanks. I would go with option 2, because I want to include the PowerApp in the SharePoint form and use the default "save" button. Can I deny the user saving his data, when the condition is true (e.g. greying out the save button)?
This is my formula, but not working yet:
If(
And(CountRows(Filter(mylist, C_x002d_Code = Trim(DataCardValue1.Text))),CountRows(Filter(mylist, Period = Trim(DataCardValue1.Text))) > 0),
"Duplicate C-Code and Period not allowed",""
)- philipp777Aug 02, 2022Copper ContributorCould someone help me out with the formula? Thanks!