cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
KevB
Level: Powered On

Copy data from a combo box to a sharepoint list

I have built quite a complex Power App with quite a large amount of moving parts, however one simple thing I cannot figure out is how I can collect data from a combo box and have that selected data populate a column in a SharePoint list.

 

The App is designed to police a process for sending files to be approved by the "Approvers". The App starts by the colleague putting data on the the app, filling in details for the submission - this is linked to a sharepoint list "Germany Payroll Approval Process" 

Then I have included a Combo box and up to this point everything works fine.

 

The combo box data is being pulled from a different list in SharePoint called “Approver List 1”, from the Title column and allows the Approver to be selected from a Secure list in SharePoint and the second box on the combo box “Approver List 1”, from the Email Column this displays the email address of the Approver. 

I now want the displayed email address (the second combo box) to populate on to a SharePoint list called "Germany Payroll Approval Process" in a column called AP1EM, this will then trigger a flow to send an email to the approver.

I have read about "Collect" or "Patch" but I am not sure what the most reliable way is of dealing with this?

I have been looking at this now for over 10 hours and I am a littel blind to the correct solution.

 

Many thanks

 

1 ACCEPTED SOLUTION

Accepted Solutions
Super User
Super User

Re: Copy data from a combo box to a sharepoint list

For example:

First(Filter(datasource,column="value))

This function would return the first record in a data source where the value of the field in the specifiec Column matches the value spcified.  Here's a specific example from the documentation found at https://docs.microsoft.com/en-us/powerapps/maker/canvas-apps/functions/function-patch

The data source is 'IceCream'

The record selection function is First(Filter(IceCream, Flavor = "Chocolate"))

And the field to be updated is Quantity.  It will be set to 400

 

Patch( IceCream,
First( Filter( IceCream, Flavor = "Chocolate" ) ), { Quantity: 400 } )
Modifies a record in the IceCream data source:
  • The ID column of the record to modify contains the value of 1. (The Chocolate record has that ID.)
  • The value in the Quantity column changes to 400.
{ ID: 1, Flavor: "Chocolate", Quantity: 400 }

The Chocolate entry in the IceCream data source has been modified.


-------------------------------------------------------------------------
If I have answered your question, please mark your post as Solved.
If you like my response, please give it a Thumbs Up.
4 REPLIES 4
Super User
Super User

Re: Copy data from a combo box to a sharepoint list

Assuming that you are using a single selection from the combo box, the easiest way to do this is to use a Patch function like this:

Patch('ame of the datasource for SharePoint list,[Some formula that uniquely identifies the record being updated],{AP1EM:Combobox1.Selected.Value})

 



-------------------------------------------------------------------------
If I have answered your question, please mark your post as Solved.
If you like my response, please give it a Thumbs Up.
KevB
Level: Powered On

Re: Copy data from a combo box to a sharepoint list

Thank you.

 

I am using a single selection from the combo box.

 

I am sorry but I dont understand [Some formula that uniquely identifies the record being updated]

 

The remainder makes sense though.

 

If you could explain that - that would be brilliant, thank you

Super User
Super User

Re: Copy data from a combo box to a sharepoint list

For example:

First(Filter(datasource,column="value))

This function would return the first record in a data source where the value of the field in the specifiec Column matches the value spcified.  Here's a specific example from the documentation found at https://docs.microsoft.com/en-us/powerapps/maker/canvas-apps/functions/function-patch

The data source is 'IceCream'

The record selection function is First(Filter(IceCream, Flavor = "Chocolate"))

And the field to be updated is Quantity.  It will be set to 400

 

Patch( IceCream,
First( Filter( IceCream, Flavor = "Chocolate" ) ), { Quantity: 400 } )
Modifies a record in the IceCream data source:
  • The ID column of the record to modify contains the value of 1. (The Chocolate record has that ID.)
  • The value in the Quantity column changes to 400.
{ ID: 1, Flavor: "Chocolate", Quantity: 400 }

The Chocolate entry in the IceCream data source has been modified.


-------------------------------------------------------------------------
If I have answered your question, please mark your post as Solved.
If you like my response, please give it a Thumbs Up.
KevB
Level: Powered On

Re: Copy data from a combo box to a sharepoint list

Thank you that makes sense and is so helpful.