Hi All,
I'm struggling with this one. I have a use case where I would like to be able to use my app to create offline stats for childrens football (mainly because it would take too long to interact with sharepoint and I might not even have good reception).
I have a collection that I am trying to post to sharepoint. SpotsStats is my Sharepoint List. cnStats is my collection.
The following syntax works (although it is nonsense!)
ForAll(cnStats,
Patch(SportStats, Defaults(SportStats),
{Weather: "My Weather Test"}))
When this code runs I end up with 4 rows in sharepoint (corresponding to the fact I have 4 rows in my collection).
My real objective is to do something along the following lines (see below) but it's not working:-
ForAll(cnStats,
Patch(SportStats, Defaults(SportStats),
{ ActionIndex: cnStats.Index, Action: cnStats.Action, Half: cnStats.Half,Result: cnStats.Result,Weather: cnStats.Weather})
Even the following is invalid syntax
ForAll(cnStats,
Patch(SportStats, Defaults(SportStats),
{Result: cnStats.Result})
This would suggest that the problem is with the cnStats.Result. I've tried wrapping this in a text function Text(cnStats.Result) but still no joy.
Any ideas what I'm missing as it's pretty frustrating.
I got it worked out as I forgot I had extra columns in my collection that were not on my sharepoint list. I ended up creating a new collection with just the columns I needed and it worked. Thanks for the reply.
hi ScottRMeredith,
I would say that your collection CalShopCart already has a column called "field_0", and this is the Name column... that's why you can't add a 2nd column with the same name.
It's a total pain when the column names get all jacked up so I suggest to recreate the Sharepoint List... If you have it on an Excel file it should be very easy to create it again and reuse your previous data and a new List. Make sure your table column name have no space or weird character to avoid jacked names again.
I am using Shane's video to create a shopping cart app. I got my initial patch working to my parent list and capturing the ID of the newly created record. When I try to do the collect formula to patch the child list I get the below warning/error message.
I created my SP list from an Excel file table and my URL based column names got all jacked up.
I have tried both field_0 and OrderID, but get the same error. I even tried with out the quotes surrounding it. Below is my list column data and then my collection data from a sample collection I loaded up.
I don't have any other ideas on how to get my child list to patch.
Thanks in advance.
Unable to patch a lookup column in SharePoint list. I am trying to bulk update just one column and since it is a lookup, I am going in circles to a point I have rely on online expertise for this.
Nothing has been working out. I wish I could get rid of that lookup column .. I am going bonkers updating.
I have 2 collections.
#1. ClearCollect(colNewReports,'New Reports') /* This is a straight collection from sharepoint list*/
I have a gallary with checkboxes for each item that is pointing to ColNewReports collection.
#2. OnCheck, I am collecting checked items into a new collection called Collect(colNewReports_updates,ThisItem)
I am trying to patch just one column called product owner in 'New Reports' Sharepoint list from colNewReports_updates.
I have tried 2 ways of patching this but it won't apply any change. I am able to patch colNewReports_updates .. no problem but I can't patch SharePoint list from this colNewReports_updates. Performance is another thing I have consider as it is going to be bulk update.
#Approach 1. ForAll(
Filter(
gal_hub_1.AllItems,
Checkbox1_2.Value = true
),
Patch(
colNewReports_updates,
LookUp(
colNewReports_updates,
ID exactin lbl_idtext.Text
),
{
'Product Owner': {
'@odata.type': "#Microsoft.Azure.Connectors.SharePoint.SPListExpandedReference",
Id: 0,
Value: rad_owner.Selected.Result
}
}
)
);
Patch(
'New Reports',
colNewReports_updates
);
****
#Aprroach 2.
ForAll(
Filter(
gal_hub_1.AllItems,
Checkbox1_2.Value = true
),
Patch(
colNewReports_updates,
LookUp(
colNewReports_updates,
ID exactin lbl_idtext.Text
),
{
'Product Owner': {
'@odata.type': "#Microsoft.Azure.Connectors.SharePoint.SPListExpandedReference",
Id: 0,
Value: rad_owner.Selected.Result
}
}
)
);
Patch('New Reports',
LookUp(
colNewReports_updates,
ID exactin 'New Reports'.ID
),
{
'Product Owner': {
'@odata.type': "#Microsoft.Azure.Connectors.SharePoint.SPListExpandedReference",
Id: 0,
Value: rad_owner.Selected.Value
}
}
)
;
I'm having a similar issue. I have Collect(MySharePointList, MyCollection) but it states
"The specified column "ColumnName" doesn't exist. The column with a similar name is "ColumnName" and I don't understand what's going on.
Hi Shane,
This approach is no longer working on my end, though it used to for a long time. Are you aware of other ways to patch the whole collection to a SP list?
Thank you,
Yulia
Thank you so much for your reply however how can I have the results from that column go to the correct column in the Sharepoint?
Collect(KIT, Filter(myCollecttion1,'ATP QTY'))
This is what I have so far where KIT is the name of the sharepoint, myCollecttion1 is the name of the Collection and ATP QTY is the field in the collection but the column in Sharepoint is ATP Quantity (SP).
you can filter the item you want to update and then patch it to the SP List
Hi @Shanescows ,
I have a PowerApp where I am bringing in fields from multiple data sources into a Collection. If I want to patch just one of those fields from my Collection to a Sharepoint lists, how would I do that since it's not all fields?
thank you!
@Shanescows How does "Collect(SharePoint, Collection)" patch all of the records in the collection?
WarrenBelz
146,745
Most Valuable Professional
RandyHayes
76,287
Super User 2024 Season 1
Pstork1
66,091
Most Valuable Professional