web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Specify DEFAULT using ...
Power Apps
Answered

Specify DEFAULT using department information in OFFICE365USER

(0) ShareShare
ReportReport
Posted on by 321

DB is SHAREEPOINT. There is a column in which the data type IT_MANAGER is a user or group.
And in FormMode.New's FORM, I want to put the word "IT" in the name of the department in the organization's OFFICE365USER as DEFAULT.
How should I do it?

Bingqiling_1-1701653771010.png

 

If(
 Form1_2.Mode = FormMode.New, 
 {
 Claims: "i:0#.f|membership|" & Office365사용자.UserProfileV2(Filter( Office365사용자.SearchUserV2({isSearchTermRequired: false}).value, "IT" in Office365사용자.UserProfileV2().department)).Mail ,
 Department: "IT운영",
 DisplayName: "",
 Email: "",
 JobTitle: "",
 Picture: ""
 }
)

 

Categories:
I have the same question (0)
  • Bingqiling Profile Picture
    321 on at

     

     

    If(
     Form1_2.Mode = FormMode.New, 
     {
     Claims: "i:0#.f|membership|" & First(Office365사용자.SearchUser({searchTerm:"IT"})).Department ,
     Department: "IT운영",
     DisplayName: "",
     Email: "",
     JobTitle: "",
     Picture: ""
     }
    )

     

    Bingqiling_2-1701655018412.png

     

     

    Bingqiling_1-1701654932494.png

    No error occurs when this code is executed. But the price is empty.

  • v-yueyun-msft Profile Picture
    Microsoft Employee on at

    Hi , @Bingqiling 

    You can try to use this code :

     

    {
     Claims: "i:0#.f|membership|" & First(Office365Users.SearchUserV2({searchTerm:"IT"}).value).Mail ,
     Department: "IT운영",
     DisplayName: First(Office365Users.SearchUserV2({searchTerm:"Aniya"}).value).DisplayName,
     Email: First(Office365Users.SearchUserV2({searchTerm:"IT"}).value).Mail ,
     JobTitle: "",
     Picture: ""
     }

     

     

    Best Regards,

    Yueyun Zhang

  • Bingqiling Profile Picture
    321 on at

    hi @v-yueyun-msft   

    An error has occurred.

    Bingqiling_0-1701655857085.png

    error 1:
    'Search UserV2' is an unknown function or
    unsupported function in namespace 'Office365Users'.

    location

    error 2:

    Function "First" has some invalid arguments.

     

  • v-yueyun-msft Profile Picture
    Microsoft Employee on at

    Hi , @Bingqiling 

    You may try to use your language function in your side :

    Office365사용자.SearchUser()

     

    Best Regards,

    Yueyun Zhang

  • Bingqiling Profile Picture
    321 on at

    hi @v-yueyun-msft 

    Bingqiling_1-1701656562560.png

     

    My mistake. Thank you.
    The error is gone
    But there's still no value

  • v-yueyun-msft Profile Picture
    Microsoft Employee on at

    Hi , @Bingqiling 

    Dose your Form is The FormMode.New, it works in my side :

    Or you can use the NewForm(FormName) to test:

    vyueyunmsft_0-1701656715271.png

    And you can check if your code return value:

    vyueyunmsft_1-1701656787701.png

     

     

    Best Regards,

    Yueyun Zhang

     

  • Bingqiling Profile Picture
    321 on at

    hi @v-yueyun-msft 

    Bingqiling_0-1701657306247.png

    ({sarchTerm: "Aniya" in "Aniya"} seems to be email information, but it will be successful if you find it by the name or email of that employee.

    The method of finding using human name or e-mail information should be excluded.
    I need to find it under the department name ({sarchTerm: "IT Operations").

  • Verified answer
    v-yueyun-msft Profile Picture
    Microsoft Employee on at

    Hi , @Bingqiling 

    Thanks for your quick response!Do you mean you want to  filter the Department field?

    vyueyunmsft_0-1701658963608.png

     

    You can try to use this code to filter the Department field:

     

     

    First( Filter( Office365Users.SearchUserV2({isSearchTermRequired: false}).value , Department ="IT" ) ).Mail
    First( Filter( Office365Users.SearchUserV2({isSearchTermRequired: false}).value ,"IT" in Department ) ).Mail

     

     

     

    {
     Claims: "i:0#.f|membership|" &First( Filter( Office365사용자.SearchUserV2({isSearchTermRequired: false}).value ,"IT" in Department ) ).Mail ,
     Department: "IT운영",
     DisplayName: First( Filter( Office365사용자.SearchUserV2({isSearchTermRequired: false}).value ,"IT" in Department ) ).DisplayName,
     Email: First( Filter( Office365사용자.SearchUserV2({isSearchTermRequired: false}).value ,"IT" in Department ) ).Mail ,
     JobTitle: "",
     Picture: ""
     }

     

     

     

     

     

    Best Regards,

    Yueyun Zhang

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Season of Sharing Community Challenge Launch!

Jump in, show your community spirit, and win prizes!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the May Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
Valantis Profile Picture

Valantis 494

#2
WarrenBelz Profile Picture

WarrenBelz 352 Most Valuable Professional

#3
11manish Profile Picture

11manish 323

Last 30 days Overall leaderboard