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

Power Apps で SharePoint ユーザー列に利用者の上司を自動で入力する

Last updated at Posted at 2025-12-11

はじめに

Microsoft のアカウントでは、以下のように、ユーザーの上司(Manager)を設定することができます。

image.png

こちらを利用して、例えば、以下のような SharePoint リストのユーザー列(ユーザーまたはグループ)の「Manager」列があったとします。

image.png

image.png

こちらのリストに対して、Power Apps でアプリ利用者の上司を自動で入力する、つまり既定値として設定する方法を紹介します。

Power Apps の設定

まず、Power Apps で以下のように、SharePoint リストに接続して、フォームコントロールを配置します。

「MySelf」列については、以下の方法でアプリ利用者が既定値([DefaultSelectedItems] プロパティ)に入るようにします。

image.png

{
    Claims: "i:0#.f|membership|" & User().Email,
    Department: "",
    DisplayName: With(
        {
            fullName: Split(
                User().FullName,
                " "
            )
        },
        Last(fullName).Value & " " & First(fullName).Value
    ),
    Email: User().Email,
    JobTitle: "",
    Picture: ""
}

アプリ利用者の上司が自動で「Manager」列に入れるためには、まず、[Office 365 ユーザー] コネクタに接続します。

image.png

次に、アプリ起動時(OnStart プロパティ)にアプリ利用者の上司の情報を取得して保存しておきます。

image.png

※保存のために変数という仕組みを使います。今回は、「gblManager」という変数を作っています

Set(
    gblManager,
    Office365ユーザー.ManagerV2(User().Email)
)

アプリ作成中の場合、以下のボタンから [OnStart] を実行します。

image.png

最後に、「Manager」列に上司が自動で入るよう、[DefaultSelectedItems] プロパティを設定します。

image.png

{
    Claims: "i:0#.f|membership|" & gblManager.mail,
    Department: "",
    DisplayName: gblManager.displayName,
    Email: gblManager.mail,
    JobTitle: "",
    Picture: ""
}

上手く入りました。テストしてみたところ、問題なく上司の情報が登録されました。

image.png

まとめ

Power Apps で SharePoint ユーザー列に利用者の上司を自動で入力する方法を紹介しました。上司を検索して入力しなくてよくなり、利用者の入力を負担を減らすことができるため、参考になれば幸いです。

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