1
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 1 year has passed since last update.

PowerAutomate でカーソル型ページネーションを使う

Last updated at Posted at 2023-04-14

カーソル型ページネーションが用いられた API を PowerAutomate で操作する方法です。

Do until のコントロールで、Cursor の情報を使って、複数ページに分割された情報を取得します。

Power Automate のクラウドフロー

cursor と Do until を抜けるための変数

cursor の情報を格納する変数を初期化します。
また、最後のページの情報を取得した際に、Do until を抜けるのに用いる変数も初期化します。
l_1517737_2424_7d3b744ceb068877ce71150f0a4151da.png
l_1517737_2425_561598bcdbbb4b9c707ee2bb1c0d7f61.png

Do until のコントロールで複数ページの情報を取得

l_1517737_2426_c33092ecb19fcb0264882a2ba73f4eb2.png
Do until を抜けるための条件を設定します。
l_1517737_2431_01d2131c943f918bf993e08602987f6c.png
HTTP コネクタで API リクエストを設定します。クエリに cursor を指定します。
image.png
JSON の解析で API のレスポンスを処理します。ページネーションのカーソルの情報を取り出します。

条件のコントロール

l_1517737_2429_905ce6a96f8e37a750328ac1715b8d48.png
最終ページに到達しカーソルの値が null の場合は Do until を抜けるための変数の値を変更します。
image.png

次ページのためのカーソルの情報が存在する場合は cursor の変数に値を設定します。

これによりページネーションされた情報の取得が可能です。

1
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?