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

patching collection item to SharePoint list lookup or choice field

(0) ShareShare
ReportReport
Posted on by

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:
I have the same question (0)
  • WarrenBelz Profile Picture
    153,051 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
    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
    153,051 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

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