cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Frequent Visitor

Patch function to match from differend SP lists

I have some doubts about my understanding of logic at the moment. I'm trying to patch an entry in a SharePoint list(sport) to reduce the number of participants in a sports unit by -1.
The Gallery does not access this SP list(Sport) but the SP list booking_1, in the booking_1 the ID of the sports unit is given to each entry in the SP list "Sport" (column IDSport) so I can create a match.

But unfortunately none of my approaches works, I am already having the data of the SP list "booking_1" saved in a collection when opening the page.

Does anyone have an idea how I could solve my problem?

HendrikKl_0-1600320540752.png

here is the error message that is currently displayed.

 

HendrikKl_1-1600320964926.png

 

 

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted

Hi,

 

It seems that the sportID is a collection and not a record. You can try:

Patch(sport, lookup(sport, ID=ThisItem.IDSPORT), {'Teilnehmer Anzahl':lookup(sportID, ID=ThisItem.IDSPORT, 'Teilnehmer Anzahl')-1});

 

otherwise you can lookup the value directly in sharepoint:

Patch(sport, lookup(sport, ID=ThisItem.IDSPORT), {'Teilnehmer Anzahl':lookup(sport, ID=ThisItem.IDSPORT, 'Teilnehmer Anzahl')-1});

 

Hope this helps,

Alex

View solution in original post

4 REPLIES 4
Highlighted
Frequent Visitor

I hope it's ok to bring threads back to the top.

Maybe someone has an idea how I could solve my problem.

Highlighted
Resolver I
Resolver I

Hi,

 

Would you be able to share how you set up 'sportID'?

 

Thanks,

Alex

Highlighted

Shure

OnVisible: get information from booking_1

HendrikKl_0-1600413246712.png

Sharepointlist "Sport"

HendrikKl_1-1600413279640.png

Collection"SportID":

HendrikKl_2-1600413302905.png

Push to booking_1 Sharepoint List for booking and pass the ID of the entry in "Sport" to booking_1 column

HendrikKl_3-1600413415625.png

 

I have already tried it without Collect directly with the sharepoint list as comparison in the patch instruction

 

Highlighted

Hi,

 

It seems that the sportID is a collection and not a record. You can try:

Patch(sport, lookup(sport, ID=ThisItem.IDSPORT), {'Teilnehmer Anzahl':lookup(sportID, ID=ThisItem.IDSPORT, 'Teilnehmer Anzahl')-1});

 

otherwise you can lookup the value directly in sharepoint:

Patch(sport, lookup(sport, ID=ThisItem.IDSPORT), {'Teilnehmer Anzahl':lookup(sport, ID=ThisItem.IDSPORT, 'Teilnehmer Anzahl')-1});

 

Hope this helps,

Alex

View solution in original post

Helpful resources

Announcements
Community Conference

Power Platform Community Conference

Check out the on demand sessions that are available now!

News & Announcements

Community Blog

Stay up tp date on the latest blogs and activities in the community News & Announcements.

secondImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Community Highlights

Community Highlights

Check out the Power Platform Community Highlights

Top Solution Authors
Top Kudoed Authors
Users online (7,737)