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?

More than 1 year has passed since last update.

Powerapps(私向けです)

Last updated at Posted at 2023-10-27

備忘録です、あしからず。。

Plannerからpowerappsへガントチャート表示

ありがとうございます。
https://terhoantila.com/2022/12/01/new-version-of-planner-gantt-chart-released/

検索して一致したものを表示(Ascending

gal :onselect

SortByColumns(Filter(LIST,L_A = Int(TextInputOD.Text) And L_B >= Int(Slider_S.Value)),"OData__xxxx__xxx_A",SortOrder.Ascending),

・LISTから L_A = INT() かつ L_B>= Int()を探す。
 これは状況により、Textの場合などあるため、適宜型を変更する
・"OData__xxxx__xxx_A"=これは日本語だと、フィールドをSPOのリストから選択する必要あり(だったはず。。。
・最後にAscendingでソートさせる(もちろんDescendingもある

更新、新規登録

コレクション登録

Collect(C_AM, {
    Title: LookUp(L_AttendanceManage, AM_name = Drop_name.Selected.AM_name, タイトル),
    AL_name: Drop_name.Selected.AM_name,
    AL_Status2: "AA",
    AL_GoHome: CurrentTime
}));

リストへコレクションから登録、更新

実際はもう少し修正が必要です。さらにやりたいこととして、当日中だけで一度だけ更新、

上書き不可、ステータスにより省略して利便性向上など。。

ForAll(C_AM, 
    With({更新ID:ThisRecord.Title,更新Time: ThisRecord.AL_CometoWork, 追加:ThisRecord},
        If(And(!IsBlank(LookUp(L_AttendanceRecord, タイトル = 更新ID)) ,!IsBlank(LookUp(L_AttendanceRecord, AR_date1 = Today()))),
            Patch(L_AttendanceRecord, LookUp(L_AttendanceRecord, タイトル = 更新ID), 
                { 
                    AR_name: 追加.AL_name, 
                    AR_status1: If(!IsBlank(追加.AL_Status1),追加.AL_Status1,LookUp(L_AttendanceRecord, タイトル = 更新ID).AR_status1), 
                    AR_date1: If(!IsBlank(追加.AL_CometoWork), 追加.AL_CometoWork,LookUp(L_AttendanceRecord, タイトル = 更新ID).AR_date1),
                }
            ),
            //一致するレコードがなければ新規作成する
            Patch(L_AttendanceRecord, Defaults(L_AttendanceRecord),
                {
                    タイトル: 更新ID,
                    AR_name: 追加.AL_name,
                    AR_status1: If(!IsBlank(追加.AL_Status1),追加.AL_Status1),

                    AR_date1: If(!IsBlank(追加.AL_CometoWork), 追加.AL_CometoWork),

            )
        );
    Notify("ステータスが新規or登録されました。" & Char(10) & "AR_status1: " & 追加.AL_Status1 & Char(10) & "AR_status2: " & 追加.AL_Status2 & Char(10) & "AR_status3: " & 追加.AL_Status3 & Char(10) & "AR_status4: " & 追加.AL_Status4, NotificationType.Success,1000)
    ));

通知(エラー確認にも)

If(f_status=1,Notify("OK"&Drop_name.Selected.AM_name&"aa",NotificationType.Success,1000),

Reference:随時追加

いつもありがとうございます。今回も参考にさせていただきました。

PowerApps最適化概要(非公式)

PowerApps委任(公式)

image.png

PowerApps Moniter

JSONについて

大変参考になりました。

JSONを用いたpowerautomateへの引数渡し(細かい所は割愛

//colSelectedItemsへD_qで選択した項目をコレクションに登録
ForAll(G_OrderList.AllItems,
    Collect(colSelectedItems,
        {
            C_01Title: 
            C_02product: 
            C_03lot: 
            C_04quantity: 
            C_05sum: 

        }
        )
    )
);

//JSONで確認したい場合は、ラベルにJSONcSIといれると、格納された//JSONデータサンプルが表示される
//これをpowerautomateでサンプルコードに入れる
Set(JSONcSI, JSON(colSelectedItems,JSONFormat.IndentFour));

//JSONデータはpowerautomate側ではテキストで受ければよい。
If(cb_42,
    pa_sendteams_管理者発注.Run(JSONcSI,T_O_2,D_period2.Selected.Value);
    Notify(cb_42&": 通知完了しました。",NotificationType.Success)
    ,
    pa_sendteams_管理者発注.Run(JSONcSI,"",D_period2.Selected.Value);
    Notify(cb_42&": 通知完了しました。",NotificationType.Success);
);

Clear(colSelectedItems);
UpdateContext({f_reset:0});
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?