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 patch a lookup ...
Power Apps
Unanswered

how to patch a lookup column in sharepoint

(0) ShareShare
ReportReport
Posted on by 101

hi ,

iam trying to patch a dropdown value to SP Lookup column.

 

In my drp (related skill) items property, i grouped  the  of the selected person relevant skills i and the skills column in sp is lookup.

Sort(GroupBy(Filter(AddColumns(
Knowledge_matrix,
"Skill_TRDI",
Skill
),
Employee_Email.Email=TextInput1.Text
),
"Skill_TRDI",
"Data"
),
"Skill_TRDI",
SortOrder.Ascending
)

 

and i want to patch the item selected from the dropdown named related skill

karthik26_0-1694008101693.png

 

Categories:
I have the same question (0)
  • Prabhakar_S Profile Picture
    735 Moderator on at

    Hi @karthik26 ,

     

    To patch a value to a SharePoint lookup column from a PowerApps dropdown, you need to format the value correctly according to the structure expected by SharePoint. SharePoint lookup columns require two pieces of information: the ID of the item being looked up and the value displayed in the dropdown.

     

    Assuming you have a dropdown named "RelatedSkill" and you want to patch a selected skill to a SharePoint list with a lookup column named "Skills". Modify the formula in the Items property of your dropdown to include both the skill display name and ID:

     
    Sort(
     GroupBy(
     Filter(
     AddColumns(Knowledge_matrix, "Skill_TRDI", Skill),
     Employee_Email.Email = TextInput1.Text
     ),
     "Skill_TRDI",
     "Data"
     ),
     "Skill_TRDI",
     SortOrder.Ascending
    )

    In the OnSelect property of a button (or wherever you want the patch to occur), use the Patch function to update the SharePoint list with the selected skill. 

     

    Patch(
    yoursharepointlistname, // Name of your SharePoint list Defaults(yoursharepointlistname), { Skill: { '@odata.type': "#Microsoft.Azure.Connectors.SharePoint.SPListExpandedLookup", Id: Dropdown1.Selected.ID, // Use the ID of the selected skill Value: Dropdown1.Selected.Data // Use the display name of the selected skill

    } } )

    This code will patch the selected skill to your SharePoint list's lookup column named "Skills." Make sure to replace "yoursharepointlistname" with the actual name of your SharePoint list and adjust the field names to match your SharePoint list's structure.

     

    Thanks!!!

     

    Please consider marking my response as the accepted solution if it successfully resolves your concern. If you found the information beneficial in other aspects, kindly express your appreciation by giving it a thumbs-up.

  • karthik26 Profile Picture
    101 on at

    Not working,showing this error

    karthik26_0-1694094786074.png

    iam using this code in onselect property of submit btn

    Patch(
    'Knowledge grid_Tickets',
    Defaults('Knowledge grid_Tickets'),
    {
    'Assigned To': {
    Claims: Concatenate(
    "i:0#.f|memebership|",
    TextInput1_1.Text
    ),
    Department: "",
    DisplayName: User().FullName,
    Email: TextInput1_1.Text,
    JobTitle: "",
    Picture: ""
    },
    Title: Req_by_input_1.Text,
    'Requested Date': Now(),
    Status: {Value: "Open"},
    Priority: Drp_priority_1.Selected,
    'Problem statement': txt_prbstat_1.Text,
    Related_skill: {
    '@odata.type': "#Microsoft.Azure.Connectors.SharePoint.SPListExpandedLookup",
    Id: drp_skillinput_1.Selected.ID,
    Value: drp_skillinput_1.Selected.Data
    },
    'Requested_by ': {
    Claims: Concatenate(
    "i:0#.f|memebership|",
    Req_by_input_1.Text
    ),
    Department: "",
    DisplayName: User().FullName,
    Email: Req_by_input_1.Text,
    JobTitle: "",
    Picture: ""
    }
    },
    atch_frm_1.Updates
    );

     

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 739 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 343 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard