The property FormMode of the SharePointForm object in PowerApps doesn't seem to follow a logical behavior throughout the use of custom SharePoint forms...
Note: I'm talking here about one screen and one SharePointForm object for the list (what I mean is: to customize my list's form, I just went to the list in SharePoint and clicked Customize forms in the PowerApps menu -> I did not duplicate the forms/screens to have different behaviors whether I am in Edit mode or View mode or New mode).
Here is what I've noticed so far on the SharePointForm object:
To recap, it seems that:
What we really need in customized SharePoint forms is to have the FormMode property to be set to the action taken by the user: 0 (Edit mode) if the user is editing an existing item, and 1 (New mode) if the user is creating a new item (and eventually 2 if the user is viewing an item).
Is this a bug ? Is my logic wrong here ?
@CWesener, @Audrie-MSFT, I'd really need help on this matter as it is disrupting my work at the moment...
Thanks a lot for your help, and feel free to ask me for more details if needed.
Emmanuel
Thank you for clarifying your questions. I have validated that with "Customize Forms" the FormMode persists as Edit and will notify the team of this bug.
Adding @_Corey_ as FYI
I will continue the investigations on the other event triggers to validate assumptions. We will continue this conversation offline. Please do log any new feature requests in the ideas forum (link below) so that others can vote on them as well.
https://powerusers.microsoft.com/t5/PowerApps-Ideas/idb-p/PowerAppsIdeas
quick link: ideas.powerapps.com
Thank you for your patience as we work to enhance the forms experience,
Audrie
@R3dKap Apologies for the tardy reply.
To answer your question, the Form should not take the DefaultMode if EditForm/NewForm/ViewForm function are called against it.
Are you still experiencing this issue? If so, can you set a global variable from the OnNew/OnEdit/OnView actions of the SharePointIntegration object and attach it to a Label just so that we can verify that the handlers are being called correctly from SharePoint?
ex.
OnNew = NewForm(SharePointForm1);Set(varMode, "New")
OnEdit = EditForm(SharePointForm1);Set(varMode, "Edit")
OnView = ViewForm(SharePointForm1);Set(varMode, "View")
ModeLabel.Text = varMode
Hi @_Corey_,
Here is how my SharePointIntegration control is configured:
Just so you know, the OnSave part does a bunch of things but finally does a SubmitForm. It does not influence the FormMode property.
Would you mind if we focus first on my first and third points (they are related indeed) first ?
Why would the FormMode property always take the value of the DefaultMode even though the user is taking a different action ? I the user creates a new item, FormMode should be New. If he edits an existing item, it should be Edit. If he views an item it should be View.
Am I wrong here ? Or is there a specific reason to the current situation ?
Hi egallis,
Your first and third points are closely related. Is the SharePointIntegration control configured correctly? It is responsible for changing Form modes depending on the action you want to take from SharePoint:
To your second point, Form mode always flips to Edit after successfully saving a record. This is by design.
Stay up to date on forum activity by subscribing. You can also customize your in-app and email Notification settings across all subscriptions.