cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Harm_Jan
Level: Powered On

How to prevent patching double records to a SharePoint list?

Hi,

I am experiencing a problem with the patch function and i was hoping you could help me with this.
Currently I am building and implementing a safety inspection PowerApp. This is a canvas app in the form of a survey. Mechanics are able to answer questions regarding the safety of their workspace and can add photos of dangerous situations. This inspection must be done once a month.

I want to patch the answered questions to a SharePoint List, this is done on basis of an ID. This ID contains the projectnumber and the number of the month (1100001_6). I want to allow the mechanic to be able to start an inspection, close the app halfway and continue later with the answers saved. So when the mechanic selects the projectnumber in the same month he should be able to continue his inspection.

I am using the following code to patch the inspection to the SP list:

If(Waarde_Controle.Text = "Onbekend Nummer"; 

Patch(Werkplekinspecties; Defaults(Werkplekinspecties);
{Titel: Dropdown_Serviceorder.Selected.No & Maand.Text};
{Projectnummer_Serviceorder:  Dropdown_Serviceorder.Selected.No;
Opdrachtgever:  Naam_Opdrachtgever.Text;
Werkverantwoordelijke:  Dropdown_Werkverantwoordelijke0.Selected.Full_Name;
Personeelsnummer_WV:  Personeelsnummer_WV.Text;
Inspecteur:  Inspecteur.Text;
Personeelsnummer:  Personeelsnummer_Inspecteur2.Text;
Tijd: Now()});

Patch( Werkplekinspecties; First( Filter( Werkplekinspecties; Titel = Titel_Sharepoint.Text) ); 

{Projectnummer_Serviceorder:  Dropdown_Serviceorder.Selected.No;
Opdrachtgever: Naam_Opdrachtgever.Text;
Werkverantwoordelijke:  Dropdown_Werkverantwoordelijke0.Selected.Full_Name;
Personeelsnummer_WV:  Personeelsnummer_WV.Text;
Inspecteur:  Inspecteur.Text;
Personeelsnummer:  Personeelsnummer_Inspecteur2.Text;
Tijd: Now()}));;


Navigate(Vraagoverzicht;ScreenTransition.Cover)


The if function checks if a variabel is known number in the SP list ("Onbekend Nummer"). This variable is programmed correctly. Sadly this formula doesnt work.

Can anyone help me with this?

1 REPLY 1
panand99
Level 10

Re: How to prevent patching double records to a SharePoint list?

Hi @Harm_Jan 

 

It looks like your "if" and "Patch" condition not correct.

could you please share the screen shot of error which you are getting?

 

 

Helpful resources

Announcements
New Ranks and Rank Icons in April

'New Ranks and Rank Icons in April

Read the announcement for more information!

Better Together’ Contest Finalists Announced!

'Better Together’ Contest Finalists Announced!

Congrats to the finalists of our ‘Better Together’-themed T-shirt design contest! Click for the top entries.

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

thirdimage

Community Summit North America

Innovate, Collaborate, Grow - The top training and networking event across the globe for Microsoft Business Applications

Top Solution Authors
Top Kudoed Authors
Users online (3,837)