Showing results for 
Search instead for 
Did you mean: 
Super User
Super User

Prevent a patch if record already exists



I've read this thread before i post


I have a Sharepoint list with a colum Name "Nom et prénom"


Annotation 2020-07-08 160813.png


Annotation 2020-07-08 161022.png


On my apps i add this


And finally on the sumit icon, i add this syntax


Annotation 2020-07-08 161615.png


I don't why i have this warning. 

Is because my column "Nom et prénom" is a person column ?

Thanks for your help




Accepted Solutions


I think DataCardValue10.Selected.Value

But check the Update property of the card containing the control.

View solution in original post

Dual Super User
Dual Super User

The warning is there because CountRows is not a delegable function.  But if you are sure that the filter will return less than 500 rows, which in this case you are, then you can ignore the warning.

If I have answered your question, please mark your post as Solved.
If you like my response, please give it a Thumbs Up.
Super User
Super User

Revise the portion:

'Nom et prénom'.Value=nonPernom.Text


If you like this post, give a Thumbs up. Where it solved your request, Mark it as a Solution to enable other users find it.

@Pstork1 Thank you but since i add the if condition, i can't submit my forms.



I modify to this ..but nothings change 😞


If(CountRows(Filter('Test QCM';'Nom et Prénom'.DisplayName=NomPrenom.text))>0;
Notify("Enregistrement existant";NotificationType.Error);;

'Test QCM'; 
Defaults('Test QCM');


Community Support
Community Support

Hi @ALP1 ,


If the NomPrenom is a Textinputbox to input Name, the Text property should begin with a capital letter.

Please modify NomPrenom.text to NomPrenom.Text.

Hope this helps.




No it's not a inputtext box it's a person or group. 



But i' ve found a tricky way, i check this on my sharepoint list 



But this is not a sustainable solution because if the user wants to change his answer late then he can not do so.




hi @v-siky-msft , @eka24 , @Pstork1 


Let me come back to you and make my need a little more clear.

When a user edits and changes their saved data, it will create a new record in the SharePoint list.

How can I avoid this?


In this example, the test user has just changed their information to update it.

Instead of changing its initial record, this created a second record




If you are using a form in Power Apps why are you using Patch() instead of SubmitForm()? 

If this post helps answer your question, please click on “Accept as Solution” to help other members find it more quickly. If you thought this post was helpful, please give it a Thumbs Up.

In fact, I have a form that is on 2 pages in the app and I need to use patch in order to be able to record the information contained in screen 1 and screen 2. The syntax works very well 





Dual Super User
Dual Super User

I didn't test the exact syntax, but you want something similar to this.


The IF checks to see if a Record with the same Title already exists.  The title field is normally an index, but use any field that will be unique for a give record. If the Title doesn't exist (IsBlank) then patch the datasource using the defaults.  That will create a new record.  Otherwise Patch the datasource using a Lookup to update the existing record.

If I have answered your question, please mark your post as Solved.
If you like my response, please give it a Thumbs Up.

Helpful resources

Power Platform Conf 2022 768x460.jpg

Join us for Microsoft Power Platform Conference

The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.

Power Platform Call June 2022 768x460.png

Power Platform Community Call

Join us for the next call on June 15, 2022 at 8am PDT.

PA Virtual Workshop Carousel 768x460.png

Register for a Free Workshop

This training provides practical hands-on experience in creating Power Apps solutions in a full-day of instructor-led App creation workshop.


New Release Planning Portal (Preview)

Check out our new release planning portal, an interactive way to plan and prepare for upcoming features in Power Platform.

Top Solution Authors
Top Kudoed Authors
Users online (1,869)