You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -508,7 +508,7 @@ This generic REST connector supports the following pagination patterns:
508
508
| Headers.*request_header* OR Headers['request_header']| "request_header" is user-defined, which references one header name in the next HTTP request. |
509
509
| EndCondition:*end_condition*| "end_condition" is user-defined, which indicates the condition that will end the pagination loop in the next HTTP request. |
510
510
| MaxRequestNumber | Indicates the maximum pagination request number. Leave it as empty means no limit. |
511
-
| SupportRFC5988 | RFC 5988 is supported in the pagination rules. By default, this is set to true. It will only be honored if no other pagination rules are defined. If you don't want to enable this default pagination rule, you can set `supportRFC5988` to `false` or just delete it in script.
511
+
| SupportRFC5988 | By default, this is set to trueif no pagination rule is defined. You can disable this rule by setting `supportRFC5988` to false or remove this property from script.|
512
512
513
513
**Supported values** in pagination rules:
514
514
@@ -517,102 +517,21 @@ This generic REST connector supports the following pagination patterns:
517
517
| Headers.*response_header* OR Headers['response_header']| "response_header" is user-defined, which references one header name in the current HTTP response, the value of which will be used to issue next request. |
518
518
| A JSONPath expression starting with "$" (representing the root of the response body) | The response body should contain only one JSON object. The JSONPath expression should return a single primitive value, which will be used to issue next request. |
519
519
520
-
**Example:**
521
-
522
-
Facebook Graph API returns response in the following structure, in which case next page's URL is represented in ***paging.next***:
The corresponding REST copy activity source configuration especially the `paginationRules` is as follows:
555
-
556
-
```json
557
-
"typeProperties": {
558
-
"source": {
559
-
"type": "RestSource",
560
-
"paginationRules": {
561
-
"AbsoluteUrl": "$.paging.next"
562
-
},
563
-
...
564
-
},
565
-
"sink": {
566
-
"type": "<sink type>"
567
-
}
568
-
}
569
-
```
570
-
571
-
**Example: Pagination rules**
572
-
573
-
If you want to send multiple sequence requests with one variable in a range, you can define a variable such as `{offset}`, `{id}` in AbsoluteUrl, Headers, QueryParameters, and define the range rule in pagination rules. See the following examples of pagination rules:
The pagination rule is: `QueryParameter.{offset} = RANGE:0:10000:1000`
593
-
594
-
- **Example 2**
595
-
596
-
You have multiple requests:
597
-
598
-
```
599
-
baseUrl/api/now/table/t1
600
-
601
-
baseUrl/api/now/table/t2
602
-
603
-
......
604
-
605
-
baseUrl/api/now/table/t100
606
-
```
607
-
You need to specify the range pagination:
608
-
609
-
`AbosoluteUrl = baseUrl/api/now/table/t{id}`
610
-
611
-
The pagination rule is: `AbsoluteUrl.{id} = RANGE:1:100:1`
520
+
>[!NOTE]
521
+
> The pagination rules in mapping data flows is different from it in copy activity in the following aspects:
522
+
>1. Range is not supported in mapping data flows.
523
+
>2.`['']` is not supported in mapping data flows. Instead, use `{}` to escape special character. For example, `body.{@odata.nextLink}`, whose JSON node `@odata.nextLink` contains special character `.` .
524
+
>3. The end condition is supported in mapping data flows, but the condition syntax is different from it in copy activity. `body` is used to indicate the response body instead of `$`. `header` is used to indicate the response header instead of `headers`. Here are two examples showing this difference:
> Mapping data flows: **"EndCondition:header.complete": "Exist"**
612
531
613
-
### Pagination examples
532
+
### Pagination rules examples
614
533
615
-
This section provides examples of sending different kinds of multiple requests.
534
+
This section provides a list of examples for pagination rules settings.
616
535
617
536
#### Example 1: Variables in QueryParameters
618
537
@@ -666,7 +585,6 @@ This example provides the configuration steps to send multiple requests whose va
666
585
RequestUrl: *https://example/table*<br/>
667
586
Request 1: `Header(id->0)`<br/>
668
587
Request 2: `Header(id->10)`<br/>
669
-
Request 2: `Header(id->20)`<br/>
670
588
......<br/>
671
589
Request 100: `Header(id->100)`<br/>
672
590
@@ -693,101 +611,112 @@ Two responses encountered in this example:<br/>
693
611
694
612
Response 1:
695
613
696
-
```
614
+
```json
697
615
{
698
-
Data: [
699
-
{key1: val1, key2: val2},
700
-
{key1: val3, key2: val4}
701
-
]
616
+
Data: [
617
+
{key1: val1, key2: val2
618
+
},
619
+
{key1: val3, key2: val4
620
+
}
621
+
]
702
622
}
703
623
```
704
624
705
625
Response 2:
706
-
```
626
+
627
+
```json
707
628
{
708
-
Data: [
709
-
{key1: val5, key2: val6},
710
-
{key1: val7, key2: val8}
711
-
]
629
+
Data: [
630
+
{key1: val5, key2: val6
631
+
},
632
+
{key1: val7, key2: val8
633
+
}
634
+
]
712
635
}
713
636
```
714
637
715
-
*Step 1*: Set the range of **Pagination rules** as Example 1 and leave the end of range empty as **"AbsoluteUrl.{offset}": "RANGE:0::1000"**.
638
+
*Step 1*: Set the range of **Pagination rules** as [Example 1](#example-1-variables-in-queryparameters) and leave the end of range empty as **"AbsoluteUrl.{offset}": "RANGE:0::1000"**.
716
639
717
-
*Step 2*: Set different end condition rules according to different last responses. Six examples are shown below:
640
+
*Step 2*: Set different end condition rules according to different last responses. See below examples:
718
641
719
-
- **Example 4.1: The pagination will end when the value of the specific node in response is empty**
642
+
-**Example 4.1: The pagination ends when the value of the specific node in response is empty**
720
643
721
644
The REST API returns the last response in the following structure:
722
645
723
-
```
646
+
```json
724
647
{
725
-
Data: []
648
+
Data: []
726
649
}
727
650
```
728
651
Set the end condition rule as **"EndCondition:$.data": "Empty"** to end the pagination when the value of the specific node in response is empty.
729
652
730
653
:::image type="content" source="media/connector-rest/pagination-example-4-1.png" alt-text="Screenshot showing the EndCondition setting for Example 4.1.":::
731
654
732
-
- **Example 4.2: The pagination will end when the value of the specific node in response dose not exist**
655
+
- **Example 4.2: The pagination ends when the value of the specific node in response dose not exist**
733
656
734
657
The REST API returns the last response in the following structure:
735
658
736
-
```
659
+
```json
737
660
{
738
661
}
739
662
```
740
663
Set the end condition rule as **"EndCondition:$.data": "NonExist"** to end the pagination when the value of the specific node in response dose not exist.
741
664
742
665
:::image type="content" source="media/connector-rest/pagination-example-4-2.png" alt-text="Screenshot showing the EndCondition setting for Example 4.2.":::
743
666
744
-
- **Example 4.3: The pagination will end when the value of the specific node in response exists**
667
+
- **Example 4.3: The pagination ends when the value of the specific node in response exists**
745
668
746
669
The REST API returns the last response in the following structure:
747
670
748
-
```
671
+
```json
749
672
{
750
-
Data: [
751
-
{key1: val991, key2: val992},
752
-
{key1: val993, key2: val994}
753
-
],
754
-
Complete: true
673
+
Data: [
674
+
{key1: val991, key2: val992
675
+
},
676
+
{key1: val993, key2: val994
677
+
}
678
+
],
679
+
Complete: true
755
680
}
756
681
```
757
682
Set the end condition rule as **"EndCondition:$.Complete": "Exist"** to end the pagination when the value of the specific node in response exists.
758
683
759
684
:::image type="content" source="media/connector-rest/pagination-example-4-3.png" alt-text="Screenshot showing the EndCondition setting for Example 4.3.":::
760
685
761
-
- **Example 4.4: The pagination will end when the value of the specific node in response is a user-defined const value**
686
+
- **Example 4.4: The pagination ends when the value of the specific node in response is a user-defined const value**
762
687
763
688
The REST API returns the response in the following structure:
764
-
```
689
+
```json
765
690
{
766
-
Data: [
767
-
{key1: val1, key2: val2},
768
-
{key1: val3, key2: val4}
769
-
],
770
-
Complete: false
691
+
Data: [
692
+
{key1: val1, key2: val2
693
+
},
694
+
{key1: val3, key2: val4
695
+
}
696
+
],
697
+
Complete: false
771
698
}
772
699
```
773
700
......
774
701
775
702
And the last response is in the following structure:
776
703
777
-
```
704
+
```json
778
705
{
779
-
Data: [
780
-
{key1: val991, key2: val992},
781
-
{key1: val993, key2: val994}
782
-
],
783
-
Complete: true
706
+
Data: [
707
+
{key1: val991, key2: val992
708
+
},
709
+
{key1: val993, key2: val994
710
+
}
711
+
],
712
+
Complete: true
784
713
}
785
714
```
786
715
Set the end condition rule as **"EndCondition:$.Complete": "Const:true"** to end the pagination when the value of the specific node in response is a user-defined const value.
787
716
788
717
:::image type="content" source="media/connector-rest/pagination-example-4-4.png" alt-text="Screenshot showing the EndCondition setting for Example 4.4.":::
789
718
790
-
- **Example 4.5: The pagination will end when the value of the header key in response is equal to user-defined const value**
719
+
- **Example 4.5: The pagination ends when the value of the header key in response equals to user-defined const value**
791
720
792
721
The header keys in REST API responses are shown in the structure below:
793
722
@@ -799,7 +728,7 @@ Data: [
799
728
800
729
:::image type="content" source="media/connector-rest/pagination-example-4-5.png" alt-text="Screenshot showing the EndCondition setting for Example 4.5.":::
801
730
802
-
- **Example 4.6: The pagination will end when the key exists in the response header**
731
+
- **Example 4.6: The pagination ends when the key exists in the response header**
803
732
804
733
The header keys in REST API responses are shown in the structure below:
805
734
@@ -811,7 +740,7 @@ Data: [
811
740
812
741
:::image type="content" source="media/connector-rest/pagination-example-4-6.png" alt-text="Screenshot showing the EndCondition setting for Example 4.6.":::
813
742
814
-
#### Example 5:The range rule is not used but the end condition can be set to avoid endless requests
743
+
#### Example 5:Set end condition to avoid endless requests when range rule is not defined
815
744
816
745
This example provides the configuration steps to send multiple requests when the range rule is not used. The end condition can be set refer to Example 4.1-4.6 to avoid endless requests. The REST API returns response in the following structure, in which case next page's URL is represented in ***paging.next***.
817
746
@@ -923,19 +852,6 @@ The pagination rule sytax is the same as in Example 8 and should be set as below
923
852
:::image type="content" source="media/connector-rest/pagination-example-9-pagination-rule.png" alt-text="Screenshot showing setting the pagination rule for Example 9.":::
924
853
925
854
926
-
>[!NOTE]
927
-
> The pagination in mapping data flows is different from it in copy activities in the following aspects:
928
-
>1. RANGE in Rest pagination is not supported in mapping data flows.
929
-
>2.`['']` is not supported in mapping data flows and will use `{}` to escape special character. For example, `body.{@odata.nextLink}`, and its JSON node `@odata.nextLink` contains special character `.` .
930
-
>3. The end condition is supported in mapping data flows, but the condition syntax is a little different from it in copy activities. `$` is not used to indicate the response body, instead, `body` is used. `headers` is not used to indicate the response header, instead, `header` is used. Here are two examples showing this difference:<br/>
0 commit comments