cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
wshuo
Frequent Visitor

try to create column by power automated

Hi there,

 

I am attempt to create column by power automated and list out my configuration like the following:

[SchemaXML] is the XML of field will be created. When I tested the flow, I found out several problem is the flow will be stuck in the section [Send an HTTP request to SharePoint] around 10 minutes at least. just wondering where the problem is

 

2020-05-11_12-35-13.png

 

 

<Field Type="Text" DisplayName="ds_name_powerautomated" Description="[MY DESCRIPTION]" Required="FALSE" EnforceUniqueValues="FALSE" Indexed="FALSE" MaxLength="255" Group="mi_Custom" StaticName="static_name_powerautomated" Name="power automated"></Field>

 

 

other settings:

^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

URI - _api/web/Fields/createfieldasxml
accept - application/json;odata=verbose
content-type - application/json;odata=verbose
Header JSON
{
"accept": "application/json;odata=verbose",
"content-type": "application/json;odata=verbose"
}
Body JSON
{
"parameters": {
"__metadata": { "type": "SP.XmlSchemaFieldCreationInformation" },
"SchemaXml": '@{variables('SchemaXML')}'
}

1 ACCEPTED SOLUTION

Accepted Solutions

@wshuo 

I tried your code as it is and it throws 'Not well formatted JSON' error. There is one closing curly brace missing, please use the below code for the body and then try. It worked for me, actually you are trying to create a site column.

{
"parameters": {
"__metadata": { "type": "SP.XmlSchemaFieldCreationInformation" },
"SchemaXml": "@{variables('SchemaXML')}"
}
}

 

 Hope it helps, please like it or mark it as a solution if it resolves ur clarification or issue
-Sudharsan K...

Hope it helps, please like it or mark it as a solution if it resolves your clarification or issue
-Sudharsan K...

View solution in original post

4 REPLIES 4
sudharsan1985
Solution Sage
Solution Sage

@wshuo 

Can you please check whether the user running the flow has permission to create a column in the list and also if you could share the error details, it will be really helpful to provide the perfect solution .

Hope it helps, please like it or mark it as a solution if it resolves your clarification or issue
-Sudharsan K...

Hi @sudharsan1985 , thanks for your response. my account is farm administrator.... I think there is no issue on it.

 

error message: "Flow run timed out. Please try again."

 

@wshuo 

I tried your code as it is and it throws 'Not well formatted JSON' error. There is one closing curly brace missing, please use the below code for the body and then try. It worked for me, actually you are trying to create a site column.

{
"parameters": {
"__metadata": { "type": "SP.XmlSchemaFieldCreationInformation" },
"SchemaXml": "@{variables('SchemaXML')}"
}
}

 

 Hope it helps, please like it or mark it as a solution if it resolves ur clarification or issue
-Sudharsan K...

Hope it helps, please like it or mark it as a solution if it resolves your clarification or issue
-Sudharsan K...

View solution in original post

adminadmin12341
New Member

@wshuo, @sudharsan1985 
you will need to escape the xml like in this example:

{
    "parameters": {
        "__metadata": {
            "type": "SP.XmlSchemaFieldCreationInformation"
        },
        "SchemaXml": "<Field Type=\"Lookup\" DisplayName=\"Onderneming\" Required=\"TRUE\" EnforceUniqueValues=\"FALSE\" List=\"{126b6513-89b8-44dc-94f8-0337202962bb}\" ShowField=\"Onderneming\" UnlimitedLengthInDocumentLibrary=\"FALSE\" RelationshipDeleteBehavior=\"None\"  StaticName=\"Onderneming\" Name=\"Onderneming\" Group=\"MaarschalkLigthart\" />"
    }
}

Helpful resources

Announcements
MPA_User Group Leader_768x460.jpg

Manage your user group events

Check out the News & Announcements to learn more.

V3_PVA CAmpaign Carousel.png

Community Challenge - Giveaways!

Participate in the Power Virtual Agents Community Challenge

Carousel 2021 Release Wave 2 Plan 768x460.jpg

2021 Release Wave 2 Plan

Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.

PowerPlatform 768x460.png

Microsoft Learn

Check out our new Discover Your Career Path blog post series and get all the details.

Users online (2,405)