Set a List Item Value before Submit on a new form in PowerApps
-
14-02-2021 - |
Question
I'm using PowerApps to develop against a SharePoint List. I have a Variable that gets set and I want to set a field in a SharePoint list (within PowerApps) with the value of the variable before "SubmitForm()"
Can anyone help me with this?
Bismarck
Solution
You can see an article here with a nice tutorial: POWER APPS: SET A FIELD VALUE.
You can set the default value to the variable in the OnSave property under SharePointIntegration.
Example:
If(
SharePointForm1.Mode=New,
Set(varDefault, User().FullName)
);
SubmitForm(SharePointForm1)
Then in the Default property on the field control, put
If(IsBlank(varDefault),ThisItem.[FieldName],varDefault)
So every time a new item gets created, it takes the default value User().FullName
when the form gets submitted, but it allows modification on the Edit Form.
Licensed under: CC-BY-SA with attribution
Not affiliated with sharepoint.stackexchange