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

Re: Patch function to match from differend SP lists

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
Regular Visitor

Re: Patch function to match from differend SP lists

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

Re: Patch function to match from differend SP lists

Hi,

 

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

 

Thanks,

Alex

Highlighted
Regular Visitor

Re: Patch function to match from differend SP lists

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
Resolver I
Resolver I

Re: Patch function to match from differend SP lists

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!

Power Platform ISV Studio

Power Platform ISV Studio

ISV Studio is designed to become the go-to Power Platform destination for ISV’s to monitor & manage published applications.

secondImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Tech Marathon

Maratón de Soluciones de Negocio Microsoft

Una semana de contenido con +100 sesiones educativas, consultorios, +10 workshops Premium, Hackaton, EXPO, Networking Hall y mucho más!

Top Solution Authors
Top Kudoed Authors
Users online (5,973)