Power AppsでSharePointリストとかから値を取得してくるとき、500件や2000件といったデータの上限数をよく耳にするので、この上限について調べてみた。
データ数制限:500件とは
Power Appsのデータの上限としてよく聞く「500件」とは、↓の公式サイトにある「委任できない場合の制限」のこと。
https://docs.microsoft.com/ja-jp/powerapps/maker/canvas-apps/delegation-overview#non-delegable-limits
要約すると、
- 委任できない数式はローカルで処理される
- その場合、事前に全データを取得する必要があるため、ネット経由で大量のデータを取得する可能性がある
- もちろん大幅に時間がかかることもあり、アプリの動作が遅い!という印象を与えるかも
- そこでPower Appsでは、ローカルで処理可能なデータ量を既定で500件としている
という内容。
要は「委任できない数式は既定で500件のみデータを持ってきて、委任できる数式は500件を超えるデータも持ってくることができる」とのこと。
そこで今回は500件を超すデータを「委任あり」と「委任なし」それぞれで持ってきた場合で表示を見比べてみる。
事前準備
今回用意したリストはこんな感じで501件のデータが入ったリスト。


それをこんな感じで「折り返し:10」で表示する。


ちなみにこの状態だと501件すべてのアイテムが表示される。


501件のデータを委任ありで表示した場合
501件のデータを委任ありFilterで表示するとこんな感じ。


501件のデータ全てが表示される。
501件のデータを委任なしで表示した場合
501件のデータを委任なしで表示するとこんな感じ。


画像のとおり500件のデータしか表示されない(持ってこない)。これがデータの上限数500件の正体。
データの上限数の変え方
データの上限数は[設定]の[全般]→[データ行の制限]で変更することができる。試しに500を501に変えてみて、


ギャラリーをリフレッシュすると、委任なしでも501件のデータが表示されるようになる。


このときSUM関数などの委任が効かない関数も、先頭500件しか計算対象にならない。
そこで、1~501を加算すると「125,751」になるはずが、↓の通り「125,250( + 501 = 125,751)」となってしまう。


おまけ:2001件のデータを扱ってみる
こんな感じで2001件のSharePointリストを作ってみて


まずは「委任あり」で表示。すると2001件データは表示されるけど、当然かなり重いw


続いて「委任なし」かつ「上限500件」で表示するとこんな感じ。さっきよりはだいぶ早い。


最後に上限を2000に変えて


ギャラリーをリフレッシュすると、2000件までデータが表示される。こちらも当然重いw


2021/8/30追記:
今回「データ行の制限」設定値以上のデータを表示できているのはギャラリーコントロールを使用しているからでした。
変数やコレクションを扱う場合はこちらの記事をご覧頂ければと思います。

今回「データ行の制限」設定値以上のデータを表示できているのはギャラリーコントロールを使用しているからでした。
変数やコレクションを扱う場合はこちらの記事をご覧頂ければと思います。

Power Apps 委任とデータ行の制限(500件~2000件)の関係を徹底解説|委任とデータ行の制限は分けて考える
これまで委任とデータ行の制限(既定は500件)が絡まると、いまいち理解がこんがらがってしまっていたけど、改めて図にしてみるとわかりやすかったのでメモ。前提前提として今回はこんなリストがあって、このリストを、わかりやすいようにデータ行の制限を...
コメント