cancel
Showing results for 
Search instead for 
Did you mean: 
darogael

Default values for a SharePoint Customize Form

Introduction
This blogs focuses on how to add defaults to a SharePoint Customized (or PowerApps) form. The list in this demo includes all the column types including managed metadata. The video walks you through the steps in detail, however, this blog with the attached text file contains all the functions incase you want to copy and paste
 
SharePoint list
Here is a screenshot of the SharePoint list, the column types and names used in this demo. You will have to modify the function to match your lists and column names.
 
picture1.png
 
Choice type field
 
picture2.png
 
Pick a date (for date only)
 
picture3.png
 
Pick a date and time
picture4.png
 
 
Lookup (The video shows you the list from which the lookup values are pulled)

picture5.png
 
Yes or No
 
picture6.png

Hyperlink
 
picture7.png

Managed Metadata
 
picture9a.pngpicture9b.png

Formulas
This contains the formulas used for the complex ones such as Choice type, User /Groups, Lookups and Managed
Metadata.
 
Choice type field
Example
 
If(SharePointForm1.Mode = FormMode.New,
LookUp(
    Choices('Add Defaults'.'Choice Type'),
    Value = "Device #1"),
Parent.Default
)
 
Users / Groups
Example

If(
    SharePointForm1.Mode = FormMode.New,
            {
                DisplayName: User().FullName,
                Claims: "i:0#.f|membership|" & User().Email
            },
            Not(IsBlank(DisplayName)),
    Parent.Default
)

Lookup
Example

If(
    SharePointForm1.Mode = FormMode.New,
    LookUp(
        Choices('Add Defaults'.lookup),
        Value = "Microsoft"),
    Parent.Default
)

Managed Metadata
Example
 
If(
    SharePointForm1.Mode = FormMode.New,
    LookUp(
        Choices('Add Defaults'.managedmetadata),
        Label = "IT"),
    Parent.Default
)
 
Video (This video walks you through the entire process step-by-step)
 
 

Conclusion
The formula's to add the default values is very similar to the formulas used in the Patch function. You can refer to the links below to see the two blogs I've written for the Patch Function.
 
Helpful Links
Comments