Skip to main content

Notifications

Power Apps - Building Power Apps
Unanswered

Patch Text Input to SharePoint person column?

(1) ShareShare
ReportReport
Posted on by 1,585
Hello,
 
I need to be able to patch a Text Input field to a SharePoint person column.
 
The Default value of my Text Input control is set to:
 
If(
    locFormDispayMode="New", 
    Office365Users.MyProfile().DisplayName,
    varCurrentCoachingAgreementRecord.Title
    )
 
I understand that I need to use this format (below) but am unsure how I bring my Text Control into it?
 
Patch(
    List, 
    Defaults(List),
    {
      Title: "New Title Value",  
      Person: {
            Claims: cmbOwner.Selected.Claims,
            Department: cmbOwner.Selected.Department,
            DisplayName: cmbOwner.Selected.DisplayName,
            Email: cmbOwner.Selected.Email,
            JobTitle: cmbOwner.Selected.JobTitle,
            Picture: cmbOwner.Selected.Picture
        }
   }
)
I need to be able to add this to my current patch statement:
 
/* THIS IS THE START OF THE PATCH FUNCTION THAT WILL PATCH DATA TO ASSOCIATED SHAREPOINT LIST COLUMNS */
Set(
varCurrentCoachingRequestRecord,
Patch(
'LiveWest Coachees',
varCurrentCoachingRequestRecord,
{
// THIS WILL PATCH BASIC TEXT DATA TO SHAREPOINT LIST
'Who was your coach?': WhoWasYourCoach_txt.Text,
'Who provided your coaching?': WhoProvidedTheCoaching_txt.Text,
'Is there anything else we need to know?': AnythingElse_txt.Text,
'Third party name': '3rdPartyName_txt'.Text,
'Third party contact details': '3rdPartyContact_txt'.Text,
'Department/Team': Department_txt.Text,


// THIS WILL PATCH YES/NO COLUMNS TO SHAREPOINT LIST
'Have you used coaching before?': HaveYouUsedCoachingBefore_tgl.Value,
'Was this coaching provided at LiveWest?': WasThisCoachingProvidedLiveWest_tgl.Value,
'Line Manager aware of application?': LineManagerAware_tgl.Value,
'Do you require information to be shared with a third party?': Share3rdParty_tgl.Value,

// THIS WILL PATCH COMPLEX CHOICE DATA TO SHAREPOINT CHOICE COLUMNS
'How did you hear about coaching in LiveWest?': {Value: HowDidYouHearCoaching_dd.Selected.Value},
'What do you want the coaching to help you with?': WhatDoYouWantCoachingtoHelpWith_combo.SelectedItems,
Location: AreasTravelTo_combo.SelectedItems,
ProvidingFeedbackToOthers_1: ProvidingFeedbackToOthers_1.Selected,
IncreasingSelfAwareness_1: IncreasingSelfAwareness_1.Selected,
CareerProgression_1: CareerProgression_1.Selected,
ProvidingFeedbackToOthers_2: ProvidingFeedbackToOthers_2.Selected,
IncreasingSelfAwareness_2: IncreasingSelfAwareness_2.Selected,
CareerProgression_2: CareerProgression_2.Selected,
'How many hours each month can you commit to meeting your coach?': CommitRegularMeetings_rdo.Selected,
TeamsVideoSession: TeamsSession_YesNo.Selected,
TelephoneSession: TelephoneCoaching_YesNo.Selected,
OfficeSpaceF2FSession: OfficeSpace_YesNo.Selected,
TravelF2FSession: TravelFaceToFace_YesNo.Selected,

// THIS WILL PATCH PEOPLE COLUMNS
Title: CoacheeName_txt.Text,

// THIS WILL PATCH DATE COLUMNS
'When did you last receive coaching?': WhenDidYouLastReceiveCoaching_date.SelectedDate

}
)
);

// THIS WILL CHECK FOR ERRORS
If(
    IsEmpty(Errors('LiveWest Coachees')),
    // ON SUCCESS
    UpdateContext({locFormDisplayMode: "View"}); //
    Notify(
        "Success: Uniform Order Form Submitted",
        NotificationType.Success
    ),
    // ON FAILURE
    Notify(
        "Errors: Unable to Submit Uniform Order Form",
        NotificationType.Error
    )
);

// THIS WILL RESET ALL FIELDS WHEN THE FORM HAS BEEN SUBMITTED */

// CLEAR VARIABLES
Set(varCurrentCoachingRequestRecord, Blank());
UpdateContext({locFormDisplayMode: Blank()});

// RESET CONTROLS
Set(varResetthemAll, true);
Set(varResetthemAll, false);

/* THIS WILL NAVIGATE THE USER TO THE SUCCESS SCREEN */
Navigate(Home_scrn,ScreenTransition.Fade)
 
 
Any suggestions would be really helpful!
 
Thanks :)
Categories:
  • Ravindra Jadhav Profile Picture
    Ravindra Jadhav 240 on at
    Patch Text Input to SharePoint person column?
    Hii,
    You Can Watch Below Youtube Video
     
  • DMSC Profile Picture
    DMSC 59 on at
    Patch Text Input to SharePoint person column?
    If it's a text label capturing the person column name details, I usually have a second text label that captures the email too (and turn the visibility off) but map this to the claims and email section of the code you have above.
     
    E.g. 
    Patch(
        List, 
        Defaults(List),
        {
          Title: "New Title Value",  
          Person: {
                Claims: Email_Label.Text,
                Department: "",
                DisplayName: Name_Label.Text,
                Email: Email_Label.Text,
                JobTitle: "",
                Picture: ""
            }
       }
    )
    If this is not a text label, apologises!
     
    DW
  • WarrenBelz Profile Picture
    WarrenBelz 145,580 on at
    Patch Text Input to SharePoint person column?
    What are you using a Person column in the first place - just use a text column. You need the person's email and name to make any useful function from a Person column.

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

Microsoft Kickstarter Events…

Register for Microsoft Kickstarter Events…

Announcing Our 2025 Season 1 Super Users!

A new season of Super Users has arrived, and we are so grateful for the daily…

Announcing Forum Attachment Improvements!

We're excited to announce that attachments for replies in forums and improved…

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 145,580

#2
RandyHayes Profile Picture

RandyHayes 76,287

#3
Pstork1 Profile Picture

Pstork1 64,909

Leaderboard