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?

Tips #011 リストの選択肢項目がRecord型だったのでPatch関数で苦戦した話

Last updated at Posted at 2024-10-22

以下の状態だと問題ないのだが、

Patch(
test_concur_request,
Defaults(test_concur_request),
{
    タイトル:DataCardValue1.Text,
    計上日:DataCardValue2.SelectedDate
})

計上日の次に支払方法を以下のように記述したら

Patch(
    test_concur_request,
    Defaults(test_concur_request),
    {
        タイトル:DataCardValue1.Text,
        計上日:DataCardValue2.SelectedDate,
        支払方法:DataCardValue5.Selected.Value
    })

次のようなエラーになった。

image.png

この引数 'payment_methods' の型は 'Record' と一致しません

だと。

Copilotに聞くと、どうやらリスト上の選択肢項目はrecord型らしい。
なんじゃそりゃ。

Copilotと建設的な話し合いにならなかったので試行錯誤した結果、
次のようにしたらうまくいった。

Patch(
    test_concur_request,
    Defaults(test_concur_request),
    {
        タイトル:DataCardValue1.Text,
        計上日:DataCardValue2.SelectedDate,
        支払方法: {
            Value: DataCardValue5.Selected.Value
        }
    })

一筋縄では行きませんね!

以上

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?