|
1 | 1 | ---
|
2 |
| -title: Working with the SharePoint Send HTTP Request Power Automate action |
| 2 | +title: Working with the SharePoint Send HTTP Request flow action in Power Automate |
3 | 3 | ms.date: 03/11/2020
|
4 | 4 | ---
|
5 | 5 |
|
6 |
| -# Working with the SharePoint Send HTTP Request Power Automate action |
| 6 | +# Working with the SharePoint Send HTTP Request flow action in Power Automate |
7 | 7 |
|
8 |
| -The SharePoint Send HTTP Request flow action allows you to construct and execute SharePoint REST API queries. This action is particularly useful in the cases when the existing SharePoint flow actions do not suffice the need or just that the action you are looking is not available yet in the SharePoint connector. |
| 8 | +The SharePoint Send HTTP Request flow action in Power Automate 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. |
9 | 9 |
|
10 |
| -Below are some of the tips on how to work effectively with the SharePoint Send HTTP Request action. |
| 10 | +See the following tips about how to work effectively with the SharePoint Send HTTP Request action. |
11 | 11 |
|
12 | 12 | > [!NOTE]
|
13 |
| -> This is a developer focused action and hence you will need to understand how SharePoint REST API works and also how to parse JSON strings in Microsoft Flow. |
| 13 | +> This is a developer-focused action. You must understand how SharePoint REST API works and also how to parse JSON strings in Power Automate. |
14 | 14 |
|
15 | 15 | ## Get to know the SharePoint REST/OData APIs
|
16 | 16 |
|
17 |
| -SharePoint has many APIs. The one we are interested in is the REST/OData APIs. You can find the complete set of REST/OData APIs [here](https://docs.microsoft.com/sharepoint/dev/sp-add-ins/get-to-know-the-sharepoint-rest-service#bk_learnmore). |
| 17 | +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](https://docs.microsoft.com/sharepoint/dev/sp-add-ins/get-to-know-the-sharepoint-rest-service#bk_learnmore). |
18 | 18 |
|
19 |
| -Though you can use the SharePoint 2010 REST APIs (_vti_bin/listdata.svc) in some cases, it is recommended to use REST/OData APIs instead. |
| 19 | +Although, in some cases, you can use the SharePoint 2010 REST APIs *(_vti_bin/listdata.svc)*, we recommend using REST/OData APIs instead. |
20 | 20 |
|
21 | 21 | ## Use JSON light
|
22 | 22 |
|
23 |
| -SharePoint REST/OData APIs support [JSON light](https://www.microsoft.com/microsoft-365/blog/2014/08/13/json-light-support-rest-sharepoint-api-released/). This means that you can set headers in your API request that will tell SharePoint whether to include any metadata in the response. In many cases, you will not require the metadata. It just makes things easier to parse the output of the action. |
| 23 | +SharePoint REST/OData APIs support [JSON light](https://www.microsoft.com/microsoft-365/blog/2014/08/13/json-light-support-rest-sharepoint-api-released/). 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. |
24 | 24 |
|
25 | 25 | To do this, just add the following header:
|
26 | 26 |
|
27 | 27 | ```http
|
28 | 28 | Accept: application/json; odata=nometadata
|
29 | 29 | ```
|
30 | 30 |
|
31 |
| -## Parsing the response |
| 31 | +## Parse the response |
32 | 32 |
|
33 |
| -If you execute a GET request, then you most probably want to parse the response. Good thing is that the default response is JSON and that makes things easier. |
| 33 | +If you execute a GET request, you generally want to parse the response. The default response is JSON, making execution simpler. |
34 | 34 |
|
35 |
| -You can do that by querying the body of the action and then parsing through the JSON array or object depending on your response. |
| 35 | +Parse the response by querying the body of the action, and then parsing through the JSON array or object depending on your response. |
36 | 36 |
|
37 |
| -You can easily build an expression to do that: |
| 37 | +To do that, build an expression: |
38 | 38 |
|
39 | 39 | ```http
|
40 | 40 | body('Send_an_HTTP_request_to_SharePoint' )['Id']
|
41 | 41 | ```
|
42 | 42 |
|
43 |
| -In cases where you have an array, then you have a JSON array object. You can use the above expression but then construct an apply to each action and use the following expression to input the variable to work with. |
| 43 | +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: |
44 | 44 |
|
45 | 45 | ```http
|
46 | 46 | body('Send_an_HTTP_request_to_SharePoint' )['value']
|
47 | 47 | ```
|
48 | 48 |
|
49 |
| -Inside the apply to each action, you can then access the individual elements with the following expression: |
| 49 | +Inside the apply to each action, you can then access the individual elements with the following expression: |
50 | 50 |
|
51 | 51 | ```http
|
52 | 52 | items('Apply_to_each')['Title']
|
53 | 53 | ```
|
54 | 54 |
|
55 |
| -## Accessing all dynamic content |
| 55 | +## Access all dynamic content |
56 | 56 |
|
57 |
| -Since the fields in the SharePoint HTTP Request action are text fields, the flow designer filters the default items in the Dynamic Content to be of string properties. |
| 57 | +Because the fields in the SharePoint HTTP Request action are text fields, the flow designer filters the default items in the **Dynamic Content** to be of string properties. |
58 | 58 |
|
59 |
| -To get the non-string properties, all you need to do is click See more for that action in the Dynamic Content and you will see all the non-string properties as well. |
60 |
| - |
61 |
| -This is particularly useful when you want to build queries where you need to pass the ID of an item which is a number and not a string. |
| 59 | +To get the non-string properties, select **See more** for that action in the **Dynamic Content**. All the non-string properties appear as well. This is particularly useful when you want to build queries where you need to pass the ID of an item which is a number and not a string. |
0 commit comments