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 / Using Collect to feed ...
Power Apps
Answered

Using Collect to feed sharepoint list

(0) ShareShare
ReportReport
Posted on by 64

I have a "Drop Down" Control which I would like to submit to a Sharepoint List "New Hire Form", however, the sytax below doesn't seem to work. 

 

Collect('New Hire Form',{Employment:Dropdown1_1.Selected.Value})

 

 

Thanks in advance for your help. 

Categories:
  • Meneghino Profile Picture
    6,949 on at

    Hi @dmarin

    What type of column is Employment?  Lookup, choice or text?

  • dmarin Profile Picture
    64 on at

    Choice.


    Here is what I am doing as a work around.

     

    The source of the drop down field points to SP List A Choice Colum.

     

    When I am using Collect, I am posting to a SP List B Text Column.

     

    I am assuming there is no way to submit to a Choice Column ?

  • Verified answer
    Meneghino Profile Picture
    6,949 on at

    Here is a demo of how to Patch to a SharePoint list choice column (it should also work for Lookup type fields, please test)

     

    Let's say your SharePoint list (MyList) has a choice column (MyChoiceColumn) with 3 choices: Choice A, Choice B, Choice C.

     

    This works:

    Patch(MyList, MyRecord, {MyChoiceColumn: {Id: 1, Value: "Choice A", '@odata.type': "#Microsoft.Azure.Connectors.SharePoint.SPListExpandedReference"}})

     

    In order to make it practical, have a dropdown control (Dropdown1) in PowerApps with the following Items property:

    Table({Id: 1, Value: "Choice A"}, {Id: 2, Value: "Choice B"}, {Id: 3, Value: "Choice C"})

     

    Then you can modify the above Patch to this:

    Patch(MyList, MyRecord, {MyChoiceColumn: {Id: Dropdown1.Selected.Id, Value: Dropdown1.Selected.Value, '@odata.type': "#Microsoft.Azure.Connectors.SharePoint.SPListExpandedReference"}})

     

    PS The choice column in SharerPoint must not allow multiple selections.

  • Meneghino Profile Picture
    6,949 on at
  • dmarin Profile Picture
    64 on at

    @Meneghino

     

    Thank you. very helpful.

     

    I am thinking that if I have a table with the choices on powerapp control, then there is no point on making a Sharepoint Choice Column type, but Text instead to keep things simple.

     

    I would only use Sharepoint Choice Column , if I am pulling the choices for the Power App Dropdown Control  from it, and pushing them as well. but I don't think this is possible.

     

     

  • Meneghino Profile Picture
    6,949 on at

    Yes, it is possible to pull the choices from SP, please see my last comment at the bottom of this:

    https://powerapps.microsoft.com/en-us/tutorials/function-datasourceinfo/

  • dmarin Profile Picture
    64 on at

    @Meneghino

     

    Can you tell me what I am doing wrong.

     

    See screenshot below of Choice Column. My Data Source is New Hire Form. 

     

    DataSourceInfo('New Hire Form',DataSourceInfo.AllowedValues,"Re_x002d_Hire_x0020__x003f_")

     

    I get warning message "The property can not use the this type of table that this rule produces due to incompatible schema" 

     

    Screen Shot 2017-02-09 at 12.28.28 PM.png

  • Meneghino Profile Picture
    6,949 on at

    Hi @dmarin

    Seems that it is not working anymore, maybe they are tinkering with this before releasing the functionality.  It did work when I wrote the post.

    In any case the schema is there, it is just inside the returned Value, but it seems to return empty values.

    It gives no error if you do this with the OnSelect of a button:

    ClearCollect(MyChoices, DataSourceInfo(Test_2017_02_09, DataSourceInfo.AllowedValues, "MyChoiceColumn"))

    But when inspecting the collection it is empty, before it had a nested column with the values...

  • dmarin Profile Picture
    64 on at

     

    Thanks @Meneghino

     

    I'll keep you posted if I get it working.

     

    On a similar topic. , do you know if  sharepoint Lookup Person/Group column type works through a Power App Control  ? or the only option is to use a form ? 

     

    I dont see any options to get this working withou using a form. 

     

    Thanks 

     

  • Meneghino Profile Picture
    6,949 on at

    Hi @dmarin

    I am sure that if it works through a form then you can reproduce the functionality outside a form.

    I have not experimented, but the solution will be the same as for this:

    https://powerusers.microsoft.com/t5/PowerApps-Forum/Solved-patching-to-SharePoint-choice-and-lookup-type-columns/m-p/21561

     

    Except that the odata string will be different and you will need to supply different fields.  You can get the constant and the different fields by dissecting an existing person in an existing list.

     

    However, I have switched to identifying my users by their Office365 ID, which is very robust.  In SharePoint I save the ID as a string.  You cannot then display the person name in SharePoint directly.  What you can do is create a list of your users and have the ID column and then have a lookup to the Office365 ID.

     

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 220 Super User 2026 Season 2

#2
WarrenBelz Profile Picture

WarrenBelz 194 Most Valuable Professional

#3
Mohsin Ali Profile Picture

Mohsin Ali 150

Last 30 days Overall leaderboard