0
1

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 5 years have passed since last update.

PowerAppsで警告を回避する方法 (How to avoid warning in PowerApps)

Posted at

images (3).jfif

PowerAppsを使う時に、Warningがあってケースと解決方法をメモいたしますので、このwerAppsを使う時に、Warningがあってケースと解決方法をメモいたしますので、この記事はよくアップデートするかもしれません :relaxed:

1. Filter機能

Filterで複雑を書かないようにしてください。
例:

Warning
Filter('[dbo].[Table]',ProductTypeDataKey=0 && EndDateInt in [0, Value(Text(Today(),"[$-ja]yyyymmdd"))]) => Warning
理由
Warning の理由は EndDateInt in [0, Value(Text(Today(),"[$-ja]yyyymmdd"))]
解決
Filter('[dbo].[Table]',ProductTypeDataKey=0 && (EndDateInt = 0 || EndDateInt >= Value(Text(Today(),"[$-ja]yyyymmdd"))))

2.DateTime

PowerAppsから、SQLServerのDateTimeを比較した時、僕が大変困りました。(一日何もできませんでした:frowning2:)
理由:SQL Serverのカラムを比較する際に、同じデータ刑にしないといけないので、PowerAppsのFunctionsで変換してみました。

方法1: PowerAppsのコンポネントをDateTimeに変換する => Error => 失敗

方法2: Integerに変換する 
Filter('[dbo].[Table]',
	Year(StartDate) >= Year(FromDatePk.SelectedDate) && 
        Month(StartDate) >= Month(FromDatePk.SelectedDate) && 
        Day(StartDate) >= Day(FromDatePk.SelectedDate)
); => got warning => 失敗 :frowning2:

方法3:DateValue(Text(StartDate)) >= DateValue(Text(FromDateS.SelectedDate))
また失敗した

解決
仕様がなかったので、もうSQLのTableに1つコラム(StartDateInt(interger))を作って、「2019/12/01」は「20191201」を保存した。
この仕方で上手く動いた。それから、Datetimeと比較ケースがあると、Int刑にして、比較する。
=> Don't trying to compare datetime of Sql Server

アップデート中...

読んで頂き、有難うございました。

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

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?