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

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / Default Value paramete...
Power Automate
Answered

Default Value parameter in List Column not being set during Power Automate Flow

(0) ShareShare
ReportReport
Posted on by
I have created flows that can create and delete multiple list columns based on two extremely useful posts:

 

The first uses variables and an array of column names and loops through the creation of the columns:  https://www.alanps1.io/power-platform/flow/flow-create-sharepoint-list-text-fields-using-rest-api-wi...

 

The second provides option on how to do a myriad REST options which I used to tweet the Creation flow above to delete multiple columns:

http://www.ludovicperrichon.com/sharepoint-rest-api-call-with-powerautomate/#removelistfields

This page gives examples on many other useful REST API options too.

 

This being said, for some reason, neither with the create or update flows work in setting the Default Value on the Yes/No columns. in my array.  Here is the information for both:

 

1. Create Flow:

 

Headers:

{
"Content-Type": "application/json;odata=verbose",
"Accept": "application/json;odata=verbose"
}

 

Body:

 

{
"__metadata": {
"type": "SP.FieldText"
},
"FieldTypeKind": 8,
"Title": "@{items('Apply_to_each_Create_Each_New_Column_String')}",
"Required": "false",
"EnforceUniqueValues": "false",
"DefaultValue": "No",
"StaticName": "@{items('Apply_to_each_Create_Each_New_Column_String')}"
}

 

2. Update Flow:

 

Header:

{
"accept": "application/json;odata=verbose",
"content-type": "application/json;odata=verbose",
"IF-MATCH": "*",
"X-HTTP-Method": "MERGE"
}

 

Body:

{
'__metadata': {
'type': 'SP.FieldMultiLineText'
},
'DefaultValue': 'No'
}

 

 

Any help would be appreciated.

Categories:
I have the same question (0)
  • Expiscornovus Profile Picture
    33,195 Most Valuable Professional on at

    Hi @NotThe1stChoice,

     

    Don't know if that DefaultValue is supported in the fields method. I always prefer the CreateFieldAsXml option because it seems to support more properties. In the body of that request you can set the Default value to 0 (aka No).

     

    Try something like below

     

    URI

    _api/web/lists/getbytitle('@{variables('ListName')}')/fields/CreateFieldAsXml

     

    Body

    { "parameters": 
    {"__metadata": {"type":"SP.XmlSchemaFieldCreationInformation"},
    "SchemaXml":"<Field DisplayName='YesField' Format='Dropdown' IsModern='TRUE' Name='YesField' Title='YesField' Type='Boolean'><Default>0</Default></Field>",
    "Options":12}
    }

     

    default_value_xml.png

  • Verified answer
    abm abm Profile Picture
    32,865 Most Valuable Professional on at

    Hi @NotThe1stChoice 

     

    For Yes/No field you can set using DefaultValue to "0" (False), Set DefaultValue to "1" (True)

     

    For Default No

    {
    "__metadata": {
    "type": "SP.FieldText"
    },
    "FieldTypeKind": 8,
    "Title": "@{items('Apply_to_each_Create_Each_New_Column_String')}",
    "Required": "false",
    "EnforceUniqueValues": "false",
    "DefaultValue": "0",
    "StaticName": "@{items('Apply_to_each_Create_Each_New_Column_String')}"
    }

     

     

    For Default Yes

    {
    "__metadata": {
    "type": "SP.FieldText"
    },
    "FieldTypeKind": 8,
    "Title": "@{items('Apply_to_each_Create_Each_New_Column_String')}",
    "Required": "false",
    "EnforceUniqueValues": "false",
    "DefaultValue": "1",
    "StaticName": "@{items('Apply_to_each_Create_Each_New_Column_String')}"
    }

  • Community Power Platform Member Profile Picture
    on at

    @Expiscornovus,

     

    I will have to look into the XML option later as it might come in handy for other things.  Looks like simply using "0" instead of "No" was the answer.

  • Community Power Platform Member Profile Picture
    on at

    @abm 

     

    That worked!  The simple and obvious solutions always allude me. 🙂  Thanks for the correction.  I wish Microsoft's documentation as clear.  

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

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 501 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 323 Moderator

#3
abm abm Profile Picture

abm abm 237 Most Valuable Professional

Last 30 days Overall leaderboard