cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
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

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
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.

Resolver I
Resolver I

Hi,

 

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

 

Thanks,

Alex

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

 

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
News & Announcements

Community Blog

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

Power Apps Community Call

Power Apps Community Call- January

Mark your calendars and join us for the next Power Apps Community Call on January 20th, 8a PST

PP Bootcamp Carousel

Global Power Platform Bootcamp

Dive into the Power Platform stack with hands-on sessions and labs, virtually delivered to you by experts and community leaders.

secondImage

Power Platform Community Conference On Demand

Watch Nick Doelman's session from the 2020 Power Platform Community Conference on demand!

Top Solution Authors
Top Kudoed Authors
Users online (6,160)