Working with the SharePoint Send HTTP Request flow action in Power Automate
In Power Automate, the SharePoint Send HTTP Request flow action lets you construct and execute SharePoint REST API queries. This action is particularly useful in cases where the existing SharePoint flow actions do not handle your requirements, or the action you are looking for is not yet available in the SharePoint connector.
To work effectively with the SharePoint Send HTTP Request action, see the following tips.
Note
This is a developer-focused action. You must understand how SharePoint REST API works and also how to parse JSON strings in Power Automate.
Get to know the SharePoint REST/OData APIs
SharePoint has many APIs. The focus here is the REST/OData APIs. For the complete set of REST/OData APIs, see Get to know the SharePoint REST service.
Although, in some cases, you can use the SharePoint 2010 REST APIs (_vti_bin/listdata.svc), we recommend using REST/OData APIs instead.
Use JSON light
SharePoint REST/OData APIs support JSON light. This means that you can set headers in your API request that inform SharePoint whether to include any metadata in the response. In many cases, you do not require the metadata. Metadata makes things simpler to parse the output of the action.
To do this, just add the following header:
Accept: application/json; odata=nometadata
Parse the response
If you execute a GET request, you generally want to parse the response. The default response is JSON, making execution simpler.
Parse the response by querying the body of the action, and then parsing through the JSON array or object depending on your response.
To do that, build an expression:
body('Send_an_HTTP_request_to_SharePoint' )['Id']
In cases where you have an array, you have a JSON array object. You can use the previous expression and then construct an apply to each action, and use the following expression to input the variable to work with:
body('Send_an_HTTP_request_to_SharePoint' )['value']
Inside the apply to each action, you can then access the individual elements with the following expression:
items('Apply_to_each')['Title']
意見反應
https://aka.ms/ContentUserFeedback。
即將登場:在 2024 年,我們將逐步淘汰 GitHub 問題作為內容的意見反應機制,並將它取代為新的意見反應系統。 如需詳細資訊,請參閱:提交並檢視相關的意見反應