I have a situation where an admin can add users to a Project Users table in an Azure SQL DB. They choose the user, the project and their role within the project. I don't want them to be able to add the same person with the same role to the same project basically. What would be the easiest way to check the form entries and see if a record that has those exact same row values exist.
Thanks.
Solved! Go to Solution.
I would do a lookup using the three fields. If the result is null (empty) then you don't have a record like that. If the result isn't empty then you do. If the result contains more than one record then you already have duplicates.
I would do a lookup using the three fields. If the result is null (empty) then you don't have a record like that. If the result isn't empty then you do. If the result contains more than one record then you already have duplicates.
Thanks for that! I used this code to check for duplicates for reference:
If(Lookup(Source, ColOneID = val && ColTwoID = val etc., "Repeat") <> "Repeat", SubmitForm(Form1), showErrorMsg)
Just to call out the obvious. Your val to match would actually be different values for each column. Otherwise I think that should work. One other thing to add. I looked later and Lookup only returns the first hit. It won't help you find duplicates. For that you would need to use Search. For your purposes I think Lookup will do just fine.
This training provides practical hands-on experience in creating Power Apps solutions in a full-day of instructor-led App creation workshop.
Come together to explore latest innovations in code and application development—and gain insights from experts from around the world.
User | Count |
---|---|
199 | |
71 | |
49 | |
41 | |
30 |
User | Count |
---|---|
266 | |
121 | |
94 | |
90 | |
81 |