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 GameDev#2 指定したレコード数のデータセットを作成し、古いデータから消していく方法

Last updated at Posted at 2018-10-15

本日のゴール

こんなことができるようにする

scoreanime.gif

何のために使うの?

予め次の処理パターンを生成しておくとか、ゲームに必要なフラグ管理テーブルみたいな感じで作ることができます。

早速作成開始!

一時的なデータセットの作り方

Collect関数を使います!
先ほどのアニメーションのデータセットだと以下のように書きます。

Collect(Data,{param:RoundDown((Rand()*255),0)});

古いデータを消すにはどうすればいいのか

Count関数とRemove関数、そしてFirst関数を使用します。

  • Countはそのデータソースに何件のデータが入っているかを返します。
  • Removeは指定したデータソースの指定した行を削除します。
  • Firstは指定したデータソースの最初の行を返します。

というわけで、10行のデータを格納し、古いデータは順次消す場合は
以下のコマンドになります。

If(Count(Data) > 10,Remove(Data,First(Data)),"")
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?