I am creating an app for my company that allows sales employees to request inventory using a mobile device.
The app is similar to a checkout shopping cart fuction BUT no money transaction is needed.
The app pulls invetory from a sharepoint list and allows the user to add items to a 'Shopping Cart' using a collection to store/display the data in a gallery.
Needs: I need to submit the collection to a SharePoint list. The collection could have multiple rows.
Question: Is this possible to submit a collection with mutliple rows into a sharepoint list??
if so how??
Solved! Go to Solution.
Hi @Anonymous
It is possible to submit collections to SharePoint with multiple rows at a time by using a combination of ForAll and Patch to submit the items.
For example, your OnSelect property of a Submit button would look something like this:
ForAll(CollectionName, Patch(SharePoint_ListName, Defaults(SharePoint_ListName), { ColumnName1: value1, ColumnName2: value2, etc})
- where value1, value2 are columns in your collection
Here's more documentation about the functions:
https://powerapps.microsoft.com/en-us/tutorials/function-patch/
https://powerapps.microsoft.com/en-us/tutorials/function-forall/
Let me know if you need more guidance 🙂
Hi @Anonymous
It is possible to submit collections to SharePoint with multiple rows at a time by using a combination of ForAll and Patch to submit the items.
For example, your OnSelect property of a Submit button would look something like this:
ForAll(CollectionName, Patch(SharePoint_ListName, Defaults(SharePoint_ListName), { ColumnName1: value1, ColumnName2: value2, etc})
- where value1, value2 are columns in your collection
Here's more documentation about the functions:
https://powerapps.microsoft.com/en-us/tutorials/function-patch/
https://powerapps.microsoft.com/en-us/tutorials/function-forall/
Let me know if you need more guidance 🙂
Thanks!
Worked like a charm...
Just to note:
ForAll(CollectionName, Patch(SharePoint_ListName, Defaults(SharePoint_ListName), { ColumnName1: value1, ColumnName2: value2, etc})
ColumnName1 - is the name of the sharepoint column
Value1 - is the collection column
Hi,
Good information. Any thoughts on this scenario?
Is there a way to accomplish this?
To make it easy, here are two sample images:
This is the Form I expect to build:
This is the records I expect to have:
Thanks in advance!
@anuarn this is something very easy to achieve in powerapps by creating your custom form, not using one by default.
For example, you would have your customer information separated from your assets, so they only get filled in once and their values are stored in variables, i.e. on a text box on the OnChange property collect the value in a variable:
Set(vClient, textbox1.Text)
Then on the assets part of the app you would have your text boxes/drop downs and a button. On the button press you would collect the information given and will clear the controls to allow a new asset information to be entered. I.e. on button OnSelect property you would have:
Collect(cAudits, {Customer: vClient, Date: vDate, Asset: textbox2.Text, Component1: textbox3.Text}); UpdateContext({resetVal: false}); UpdateContext({resetVal: true})
Then you would use the resetVal variable on the textbox Reset property (hint: the value needs to be changed from false to true in order to take effect).
Then you would give them a button to submit all the information and on that button you will Patch your Collection to the SharePoint list.
Hope this makes sense 🙂
Thanks a lot @Anonymous!
This was very helpful for me to move forward.
I am having exactly the same issue as Winston. My connections look right but it is not even offering me any of the fields from my table.
Just double checked my connections/data sources and they are good. I am trying to Patch Office365User data from a collection with the headings of "NomineeName" and "JobTitle". My sharepoint list has a person field for the Nominee and a text field for theNomineeTitle. However, it is not showing me any fields from my sharepoint list but it does offer me the list as an option behind "patch" and "defaults". The names in my sharepoint list are consistent of where I check.
If I type the name of the SharePoint column in since it does not offer it to me, I get the message "The type of this argument "Nominee" does not match the expected type 'Record'. Found type 'Text'.
ForAll(NewCollection,Collect(MySPList,{LTitle:CollectionTitle,LcolNumber:Value(CollectioncolNumber)}))
You can try this also.
User | Count |
---|---|
250 | |
102 | |
94 | |
47 | |
37 |