Hi,
I've read this thread before i post https://powerusers.microsoft.com/t5/Building-Power-Apps/Prevent-a-patch-if-record-already-exists/m-p...
I have a Sharepoint list with a colum Name "Nom et prénom"
On my apps i add this
And finally on the sumit icon, i add this syntax
I don't why i have this warning.
Is because my column "Nom et prénom" is a person column ?
Thanks for your help
Solved! Go to Solution.
Hi @Anonymous ,
That is because that you use Patch with the Defaults function, which is intended to create records. Reference: Patch function
If you want to make modification, the Base Record should be the Record you try to modify, which should be the Items property of Form.
For Example, if the EditForm Items property is Gallery1.Selected, then Patch formula should be like this:
Patch(
'Test QCM';
Gallery1.Selected;
EditForm1.Updates;
EditForm2.Updates
)
Just try to replace the Defaults('Test QCM') by the code in Items property of Form.
Hope this helps.
Sik
Hi,
Sorry for the delay.
I use this syntax
If(IsBlank(LookUp('Formulaire Digital Formateurs';'Votre nom'=Votre_nom_DataCard2.text));
Patch('Formulaire Digital Formateurs'; Defaults('Formulaire Digital Formateurs');
EditForm1.Updates;EditForm2.Updates);
Patch('Formulaire Digital Formateurs';LookUp('Formulaire Digital Formateurs';'Votre nom'=Votre_nom_DataCard2.Text;EditForm1.Updates;EditForm2.Updates);;
Navigate(Success;ScreenTransition.Fade)
but i'm note sure with
Title=TitleDatacard.Text
Is title is Votre_nom_Datacard2 ?
Hi @Anonymous
It looked like there were some syntax errors in your formula. See if this works for you
With({'Formulaire Digital Formateurs':FDF});
If(
IsBlank(
LookUp(FDF;'Votre nom' = Votre_nom_DataCard2.Text
)
);
Patch(
FDF; Defaults(
FDF
); EditForm1.Updates; EditForm2.Updates
);
Patch(
FDF; LookUp(
FDF;'Votre nom' = Votre_nom_DataCard2.Text ;
); EditForm1.Updates; EditForm2.Updates
)
);;
Navigate(
Success;ScreenTransition.Fade
)
You're right. I forgot ) in the syntax
I still have errors (only 4)
I think it comes from the type of field Votre nom.
In SharePoint, this column Votre nom is a Person or group type
In PowerApps, i have this
if i click on DatacardValue, i have this
I don't have the option .text
And I think that's where my mistake came from.
So I changed my syntax like this
Now I have 2 errors because i don't know what to add after DatacardValue10.
do you have an idea ?
@Anonymous
I think DataCardValue10.Selected.Value
But check the Update property of the card containing the control.
thank you it's working 🙂
User | Count |
---|---|
251 | |
102 | |
94 | |
48 | |
37 |