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...
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
October Events

Mark Your Calendars

So many events happening this month - don't miss out!

 WHAT’S NEXT AT MICROSOFT IGNITE 2022

WHAT’S NEXT AT MICROSOFT IGNITE 2022

Explore the latest innovations, learn from product experts and partners, level up your skillset, and create connections from around the world.

Register for a Free Workshop.png

Register for a Free Workshop

Learn to digitize and optimize business processes and connect all your applications to share data in real time.

Users online (2,934)