web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / Set SharePoint Column ...
Power Automate
Unanswered

Set SharePoint Column Default Values using Flow

(0) ShareShare
ReportReport
Posted on by 43

Hi, I'm wondering if anyone knows if it is possible to set the Column Default Values for a SharePoint Online folder using Flow.

Possibly using a HTTP request?

I have come across this article SharePoint Online Update default value to a field in a list using Rest API, however I believe this only changes the default value of the site column, and not for a folder.

Thanks.

Categories:
I have the same question (0)
  • v-yamao-msft Profile Picture
    Microsoft Employee on at

    Hi @swhitmore ,

     

    It could be achieved by using SharePoint action Send an HTTP request to SharePoint.

    https://docs.microsoft.com/en-us/connectors/sharepointonline/#actions

    By the way, here is a doc on working with folders and files with REST, please check it for a reference:

    https://docs.microsoft.com/en-us/sharepoint/dev/sp-add-ins/working-with-folders-and-files-with-rest

    Please take a try with it on your side.

     

    Best regards,

    Mabel

     

  • swhitmore Profile Picture
    43 on at

    Thanks @v-yamao-msft . I figured it could likely be done with a REST API call, but I couldn't find one that would work in SharePoint online.

     

    Edit: I managed to get this action working, but not completely

    Untitled.png

    However this updates the default value here:

    Capture.PNG

     

    But I need to update it here:Untitled.png

     

     

  • HaydenSinclair Profile Picture
    101 on at
    This method works. 
     
    DefaultImage.jpg
     
    If you remove the default value from the library settings default value page, the column default value will take over - as per the screenshot above.
     
    This might save someone typing out the text from the screenshots...  
     
    _api/web/lists/GetByTitle('Documents')/Fields/getbytitle('Project Details')
    accept                    application/json;odata=verbose
    content-type          application/json;odata=verbose 
    X-HTTP-Method     MERGE
    IF-MATCH               *
    X-RequestDigest    $('#_REQUESTDIGEST').val()
    {'__metadata':{'type':'SP.Field'}, 'DefaultValue':'Hello Updated Value'}
     
     
     
     
  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    @HaydenSinclair  The method you describe is exactly the same as the one stated previously. Using "/Fields/" is setting the default on the field at the library level, not on individual folders. You do not have any folders in your doc library.  If you create folders and want separate default values for a column/field on a folder level, the method you describe does not work.

     

    The only way I've found to do this is via PowerShell, but that doesn't solve automating creating document libraries that contain folders with pre-set default values so that when someone drops a file into a folder, those default values are set on the document. I have a Flow that changes the value on the document based on what folder it is placed in, but that only works if the document library already exists so you can create a Flow that runs on it. I'm creating new libraries and want to preset those values within the create library Flow, since it doesn't appear that you can create a Flow from a Flow (except for admin flows).  

  • MC-09121519-0 Profile Picture
    on at

    One way is to update the client_LocationBasedDefaults.html file.

     

    Use a SP HTTP GET to read the file content and put the result into a string variable

    Ex:

    _api/Web/GetFileByServerRelativePath(decodedurl='/sites/yoursite/Shared Documents/Forms/client_LocationBasedDefaults.html')/$value?binaryStringResponseBody=true

     

    Then you will need to build a string to add your folder defaultvalue info at the end

     

    You new folder info that you will append to the file content will be something like:

     

    <a href="/sites/YouSite/Shared%20Documents/yourNewFolder"><DefaultValue FieldName="udlProjectNo">YourValue</DefaultValue></a>

     

    Note: If your folder contains spaces, replace spaces with %20'

     

    Then write back the new file content with a SP HTTP PUT

     

    _api/Web/GetFileByServerRelativePath(decodedurl='/sites/YourSite/Shared Documents/Forms/client_LocationBasedDefaults.html')/$value

     

    The body will be your new default values string.

     

    Microsoft should provide better api commands to do these things....

     

    Hope it helps

     

  • wood Profile Picture
    2 on at

    Hello All,

     

    Can this method to set default column value also be achieved with the new unified Graph Rest API? In case yes, can someone point me to some examples

  • niclasdahl Profile Picture
    19 on at

    @CoupalM 

     

    And this works with the 'Send an HTTP request to SharePoint' action in flow for this?

     

    If so, could you please provide some screens with the various steps and which string goes where?

  • Bart2s4 Profile Picture
    2 on at

    The only way I can think of , which is fairly easy is to use Power Automate with a PNP powershell call. The issue with this is that you need for executing the power automate a power automate pro license, which cost around 13 euro a month.

     

    connect the power automate with a runbook on azure, and use the follwing powershell command to set default value on specific folder:

     

    Set-PnPDefaultColumnValues -List Documents -Field MyTextField -Value "DefaultValue" -Folder "My folder"

    Or use
    Set-PnPDefaultColumnValues -List Documents -Field TaxKeyword -Value "Company|Locations|Stockholm"
    To assign a default value based on managed metadata.

     

    I hope this helps

     

     

     

  • Rhiassuring Profile Picture
    8,692 Moderator on at

    Hey there, I figured it out, and I'm super excited, so I'm posting it in all the unanswered threads - Power Automate only, no PnP fanciness needed.

    https://powerusers.microsoft.com/t5/Building-Flows/Setting-the-default-column-value-of-a-subfolder-in-a-document/m-p/1701525/highlight/true#M188650

  • DConstant Profile Picture
    2 on at

    I have created the column aynamicaly with the flow, now I want to add it to the view after being created. can anyone help please?

     

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Leaderboard > Power Automate

#1
Haque Profile Picture

Haque 304

#2
David_MA Profile Picture

David_MA 245 Super User 2026 Season 1

#3
Expiscornovus Profile Picture

Expiscornovus 243 Most Valuable Professional

Last 30 days Overall leaderboard