0
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?

Power Automate で SharePoint リストの最後の ID を取得する方法

Posted at

背景

マスターとスレーブ、2 つの SharePoint リストを完全に同期させたい場面があった。

Power Automate では任意の ID を指定してアイテムを作成できないので、まずはマスターとスレーブの 行数を一致させて、スレーブ側に「更新」アクションでデータをコピーする ことでID をそろえる方向で検証。

そのために、Power Automate でマスター側の 最後の ID を取る必要が出てきたのでメモ。

最後の ID を取る方法

「複数の項目の取得」 アクション

  1. 並べ替え順ID desc と入力(降順で並べ替え)
  2. 上から順に取得1 を指定(最新 1 件だけ取得)

スクリーンショット 2025-10-09 004703.png

作成 アクション

作成アクションなどで以下の式を使う。

outputs('複数の項目の取得')?['body/value']?[0]?['ID']

スクリーンショット 2025-10-09 004713.png

これでリストの最後(最大)の ID が取れる。

スクリーンショット 2025-10-09 004650.png

0
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
0
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?