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

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / How To: Patching peopl...
Power Apps
Answered

How To: Patching people selection with if is blank

(0) ShareShare
ReportReport
Posted on by 65

I have patched through a people selection using Shane Young's tutorial .  The issue I came across is if it is not selected it won't patch through.  How can I wrap a function around it to still patch through the rest of the values and leave that selection blank?

 

Error received if left blank:  'The specified user could not be found'

 

{Title: galProjectList.Selected.'Short Title',
Collaborator: {
 '@odata.type': "#Microsoft.Azure.Connectors.SharePoint.SPListExpandedReference",
 Claims: "i:0#.f|membership|" & Lower(DS_Collab_Select.Selected.Mail),
 Department: "",
 DisplayName: "",
 Email: DS_Collab_Select.Selected.Mail,
 JobTitle: ".",
 Picture: "."
 },

 

Categories:
I have the same question (0)
  • Verified answer
    KrishnaV Profile Picture
    5,023 on at

    Hi @mattthew ,

     

    Sorry for the little late in reply, here is the code snippet to patch even though we don't have value for people field.

    Patch(
     'Project Details',
     Defaults('Project Details'),
     {Title: galProjectList.Selected.'Short Title'},
     If(
     !IsBlank(DS_Collab_Select.Selected.Mail),
     {
     Collaborator: {
     '@odata.type': "#Microsoft.Azure.Connectors.SharePoint.SPListExpandedReference",
     Claims: "i:0#.f|membership|" & Lower(DS_Collab_Select.Selected.Mail),
     Department: "",
     DisplayName: "",
     Email: Lower(DS_Collab_Select.Selected.Mail),
     JobTitle: ".",
     Picture: "."
     }
     }
     )
    );

    Here is the working model of the above code block.

    Patch with people picker.gif

     

    I hope this resolved your issue if you see any challenge let me know I am always happy to help.

     

    Regards,

    Krishna
    If this post helps, then please consider Accept it as the solution and give thumbs-up to help the other members find it more.

  • mattthew Profile Picture
    65 on at

    Thanks @KrishnaV 

  • Community Power Platform Member Profile Picture
    on at

    Hi Krishna,

     

    Actually, I tried on the same, I am not getting any error, but only people picker is not updating to blank, remaining fields are okay, could you help on the same

     

    Patch(
    'Patch', ThisItem,
    { Title: DataCardValue1.Text},
    // {REGION: DataCardValue2.Selecteditems}
    If(
    !IsBlank(DataCardValue3.Selected.Email),
    {
    Person:{
    '@odata.type': "#Microsoft.Azure.Connectors.SharePoint.SPListExpandedReference",
    Claims: "i:0#.f|membership|" & Lower(DataCardValue3.Selected.Email),
    Department: "",
    DisplayName: "",
    Email: User().Email,
    JobTitle: ".",
    Picture: "."
    }
    }
    )


    )

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

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 711 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 319 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard