5
3

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.

Power Automate で Dataverse の日付型の列でフィルターする

Last updated at Posted at 2023-01-15

はじめに

今回は、Power Automate で Dataverse の以下のような日付型の列でフィルターするアプローチについて、少し癖があるので、自分自身の備忘も兼ねて説明します。

image.png

利用シナリオとしては、例えば、日付列をベースに、一定の期間のレコードを削除したり退避する、以下のように、チャットボット (Power Virtual Agents) を通じて、勤務状況をシェアするアプリにデータを登録 ( 該当日付に既にデータがあるかフィルターをし、データがある場合は既存のデータを変更する) するようなものがあります。

image.png

実装アプローチ

まず、失敗例からお伝えします。以下のような感じで、Dataverse のデータをフィルターしようとしました。

image.png
実行すると、以下のようなエラーで型が異なる旨のエラーが発生します。
image.png
最終的には、以下のようにすることで動作しました。
image.png
肝となるのは以下の部分です。formatDateTime で、変換すること、また、その際、ISO 8601 形式にする必要があることです。

formatDateTime(body('時間への追加'),'yyyy-MM-dd')

実行してみると、エラーがなく、該当するレコードが取得できました。
image.png

5
3
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
5
3

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?