Forum Discussion

DiegoQUIBIM's avatar
DiegoQUIBIM
Copper Contributor
Jan 25, 2024

Problem creating a list using Power Automate

Hi everyone,

 

I'm trying to automatically create a list through Power Automate using the "Send a HTTP Request to Sharepoint". 

It seems I have some problems with the headers (encabezados) or body (cuerpo):

because I always recieve the following error:

any idea on how to solve this issue?

 

Thanks,

Regards,

Diego.

  • ProSolutions's avatar
    ProSolutions
    Iron Contributor
    Hello DiegoQuibim, When creating a list using "Send a HTTP Request to SharePoint" in Power Automate, ensure you're providing the correct headers and body. Here's an example: **Headers:** - Key: Accept, Value: application/json;odata=verbose - Key: Content-Type, Value: application/json;odata=verbose - Key: Authorization, Value: Bearer YOUR_ACCESS_TOKEN Note: Replace YOUR_ACCESS_TOKEN with the actual access token or ensure your HTTP request is authenticated properly. **Body:** You need to define the properties for your list in the body. Here's an example: ```json { "headers": { "__metadata": { "type": "SP.List" }, "AllowContentTypes": true, "BaseTemplate": 100, "ContentTypesEnabled": true, "Description": "Your list description", "Title": "Your List Name" } } ``` Make sure to customize "Description" and "Title" according to your list requirements. Remember, authentication is crucial for SharePoint requests. Ensure that you have the necessary permissions and the access token is valid. If you encounter specific issues or errors, feel free to share more details, and I can provide further assistance. Have a great day DiegoQuibi!
    • DiegoQUIBIM's avatar
      DiegoQUIBIM
      Copper Contributor
      Thank you Elgin for your prompt response!
      I believe my problem is with the ACCESS_TOKEN. Do you know how can I get the actual access token?

Resources