cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
LukasSliuzas
Helper II
Helper II

People picker search field doesn't work after If statement

Hello,

 

I have created a people picker where tab DefaultSelectedItems has if statement. Would it be possible to make that search tab would work if DefaultSelectedItems is empty? 

 

Current if Statement is:

 

If( DivisionFilter.Text = "DivisionName",

{
'@odata.type': "#Microsoft.Azure.Connectors.SharePoint.SPListExpandedReference",
Claims:"i:0#.f|membership|" & "EMAIL",
Department: "",
DisplayName: "NAME",
Email: "EMAIL",
JobTitle: ".",
Picture: "."
})

 

 

1 ACCEPTED SOLUTION

Accepted Solutions
RandyHayes
Super User
Super User

@LukasSliuzas 

If you want it to be blank, then you can set it to Blank()

What is the entire formula you have and what issue are you currently having with it?

 

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up below. Solved your problem? - Click on Accept as Solution below. Others seeking the same answers will be happy you did.
NOTE: My normal response times will be Mon to Fri from 1 PM to 10 PM UTC (and lots of other times too!)
Check out my PowerApps Videos too! And, follow me on Twitter @RandyHayes

Really want to show your appreciation? Buy Me A Cup Of Coffee!

View solution in original post

3 REPLIES 3
LukasSliuzas
Helper II
Helper II

I just figured it out myself

 

Else statement needs to be this

{
Claims:"i:0#.f|membership|" & Office365Users.ManagerV2(User().Email).mail,
Department:"",
DisplayName: Office365Users.ManagerV2(User().Email).displayName,
Email: Office365Users.ManagerV2(User().Email).mail,
JobTitle:"",
Picture:""
}

 

EDIT:

 

Got too happy early. This does work but it will show my direct manager and I need the field to blank

RandyHayes
Super User
Super User

@LukasSliuzas 

If you want it to be blank, then you can set it to Blank()

What is the entire formula you have and what issue are you currently having with it?

 

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up below. Solved your problem? - Click on Accept as Solution below. Others seeking the same answers will be happy you did.
NOTE: My normal response times will be Mon to Fri from 1 PM to 10 PM UTC (and lots of other times too!)
Check out my PowerApps Videos too! And, follow me on Twitter @RandyHayes

Really want to show your appreciation? Buy Me A Cup Of Coffee!

I did try setting else condition to Blank() and it didn't work for some reason. I wasn't able to find any users in the search field but this time worked, most likely did some kind of mistake and didn't notice

Helpful resources

Announcements
Ignite 2022

WHAT’S NEXT AT MICROSOFT IGNITE 2022

Explore the latest innovations, learn from product experts and partners, level up your skillset, and create connections from around the world.

Power Apps Africa Challenge 2022

Power Apps Africa Challenge

Your chance to join an engaging competition of Power Platform enthusiasts.

Users online (1,648)