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

カンマ区切りの文字列をコンボボックスの選択肢としてデフォルト表示する

Last updated at Posted at 2025-07-07

ごきげんよう、百合宮桜(Miyu)です(≧▽≦)
突然ですが、今日はゆりみーのお悩み相談室のコーナーです!!!

お悩み概要

本日のお悩みは「カンマ区切りで登録した文字列をコンボボックスのデフォルト値として設定したい」というものです。

やりたいこととしては多分こういうイメージですね。
SharePoint Lists にはカンマ区切りで入っているデータ(組列)が
image.png

アプリ上では選択肢としてコンボボックスに表示されていてほしいというイメージです。
image.png

解決方法

これはわりと簡単にできます。
複数選択が許可されたコンボボックスは選択された値をテーブル型で持ちます。
テーブル型というのは配列のことです。
image.png

その為、カンマ区切りの文字列を配列に変換して、コンボボックスの DefaultSelectedItems プロパティに入れてしまえば良いのです。

Split(ThisItem.列名,",")

image.png
Split 関数は特定の文字をキーに文字列を分割して、配列(テーブル型)化する関数です。今回は「カンマ(,)」のところで分割しました。

終わりに

いかがでしたか?
コンボボックスがどういう仕組みになっているかを知っていると、ラクに既存レコード編集時の手間を削減できます。時間がある時にどんな動きをするんだろう? とじっくり向き合ってみるのも良いかもしれませんね。
それではごきげんよう!!

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