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 / patching collection it...
Power Apps
Answered

patching collection item to SharePoint list lookup or choice field

(0) ShareShare
ReportReport
Posted on by Microsoft Employee

Someone, please help me with patching collection items to SharePoint list.

I can patch to single text field but cannot when share point field are  lookup or choice field.

 

ForAll(coll_customer,

Patch(SP_customer,

First(Filter(SP_customer ,ID =ID_1)),

              { comment: comment _1}))

 

Here’s my collection item.

Collection name: coll_customer

 

ID_1

shop_name_1

category_1

comment _1

1

A mart

book

AAA

2

B mart

food;#book

A

3

C mart

food

A

4

C mart ;#D mart

food;#book

 

5

D mart

food

AA

6

D mart;#A mart

na

SS

 

I would like to patch to following SharePoint list.

SharePoint List Name : SP_customer

 

ID

shop_name

(lookup form SharePoint List “SP_Shop”SharePoint List
,multi selection)

category
(choice,multi selection)

comment

1

 

 

 

2

 

 

 

3

 

 

 

4

 

 

 

5

 

 

 

6

 

 

 

Categories:
  • WarrenBelz Profile Picture
    156,963 Most Valuable Professional on at

    Hi @Anonymous ,

    Have a look at this video from @aprildunnam for the process required.

    You will see the complexity of what you need to do to achieve this and maybe a better option would probably be to send to the output to a Text field or use a form and SubmitForm and it will take care of the writing for you.

    If you really need to proceed, please have a go at it and post your result.

     

    Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

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

    Hi @Anonymous ,

    Do you want to use collection to update sharepoint list?

    Firstly, let me explain why you did not succeed: 

    The formula that you use needs the fields' data type in collection and in list are the same.

    Since comment_1 and comment are both text type, you could directly use   { comment: comment _1} to get value.

    However, for complex data type( lookup, choice), you need complex formula.

     

    Could you tell me shop_name looks up to which field in  "SP_Shop”SharePoint List? and that field's data type?

    I assume that shop_name looks up to Title field in "SP_Shop”SharePoint List and Title field is text type.

    If so, please try this:

    ForAll(coll_customer,
     Patch(SP_customer,
     First(Filter(SP_customer ,ID =ID_1)),
     { comment: comment _1,
    	 shop_name: RenameColumns(
     AddColumns(
     Split(shop_name_1,";#"),
     "Id",
     LookUp(SP_Shop,Title=Result,ID)
     ),
     "Result","Value"
     ),
     category:RenameColumns(Split(category_1,";#"), 
     "Result","Value"
     )
     }
     )

    You need to notice the structure of multiple lookup field and multiple choice field.

    Multiple lookup field is a table with two columns named Value and Id.

    Multiple choice field is a table with one column named Value.

    So you need to re-shape text value to the structure that the purpose field needs.

     

    What's more, you not only need to connect your app with SP_customer list, but also need to connect your app with SP_Shoplist.

    (You need the related field's ID value to update lookup field.)

     

     

    Best regards,

  • WarrenBelz Profile Picture
    156,963 Most Valuable Professional on at

    @Anonymous ,

    Please go with @v-yutliu-msft on this - it is not a structure I ever attempt.

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 Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 224 Super User 2026 Season 2

#2
WarrenBelz Profile Picture

WarrenBelz 189 Most Valuable Professional

#3
Mohsin Ali Profile Picture

Mohsin Ali 126

Last 30 days Overall leaderboard