Hello all,
I am building an app using Dataverse and I am trying to update the status column to "submitted" when the user successfully submits a request.
Here's my formula :
If
(IsBlankOrError(Form3) Or IsEmpty(DataCardValue18.Attachments); // if compulsory fields are missing or in error
Notify("Champs manquants, veuillez compléter tous les champs obligatoires";Error;4000); // then do not submit form and notify error
SubmitForm(Form3) && UpdateContext({Statut de la demande : "Soumise"}) && Navigate(Succès) && ResetForm(Form3)) // otherwise submit form and show success screen
I'm using update context but it has no impact on the status.
Thanks in advance !
Hi @Nina2021 ,
Try this syntax
If(
IsBlankOrError(Form3) ||
IsEmpty(DataCardValue18.Attachments);
Notify(
"Champs manquants, veuillez compléter tous les champs obligatoires";
Error;4000
);
SubmitForm(Form3);;
UpdateContext({Statut de la demande : "Soumise"});;
Navigate(Succès);;
ResetForm(Form3)
)
Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.
Hello @WarrenBelz ,
Thanks for your reply.
I tried that but it didn't work. The UpdateContext formula doesn't seem to recognise my column. I tried with the default name (cr6fa_statutdelademande) and the screen name (Statut de la demande) but in both cases, it doesn't recognise the field.
Thanks !
Hi @Nina2021 ,
What are you trying to do with UpdateContext here? It sets a Variable, not a field or control value. Are you trying to change the value of your field after you submit the form?
Hi @WarrenBelz ,
Thank you for that info. UpdateContext might not be the correct function then.
What I am trying to do is quite basic actually : when a user submits a form, the status of his/her request switches from "draft" to "submitted for approval". Then, when his/her manager approves the request, the status switches from "submitted for approval" to "approved".
Thanks !
Hi @Nina2021 ,
I am not a DataVerse user (this is much easier in SharePoint), but try this
If(
IsBlankOrError(Form3) ||
IsEmpty(DataCardValue18.Attachments);
Notify(
"Champs manquants, veuillez compléter tous les champs obligatoires";
Error;4000
);
SubmitForm(Form3);;
Patch(
YourTableName;
Form3.LastSubmit;
{Statut de la demande:"Soumise"}
);;
Navigate(Succès);;
ResetForm(Form3)
)
Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.
Hello @WarrenBelz ,
I think that the Patch function isn't working properly for Dataverse. I keep having error issues with it.
Thank you for your help !
Hi @WarrenBelz ,
Yes I do. It's the timesheet number. It's generated automatically when the timesheet is created.
Thanks @Nina2021 ,
Instead of Form3.LastSubmit, put (change if field name wrong)
{TimeSheetNo:Form3.LastSubmit.TimesheetNo}
Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.
The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.
User | Count |
---|---|
161 | |
91 | |
67 | |
63 | |
62 |
User | Count |
---|---|
216 | |
159 | |
96 | |
86 | |
79 |