cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
wshuo
Regular 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
Super User
Super User

@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
Process Advisor

Introducing Process Advisor

Check out the new Process Advisor community forum board!

MPA User Group

Welcome to the User Group Public Preview

Check out new user group experience and if you are a leader please create your group

MBAS on Demand

Microsoft Business Applications Summit sessions

On-demand access to all the great content presented by the product teams and community members! #MSBizAppsSummit #CommunityRocks

Users online (34,754)