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

BakerAlex
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
PA User Group

Welcome to the User Group Public Preview

Check out new user group experience and if you are a leader please create your group

MBAS Attendee Badge

Claim Your Badge & Digital Swag!

Check out how to claim yours today!

secondImage

Are Your Ready?

Test your skills now with the Cloud Skill Challenge.

Top Solution Authors
Top Kudoed Authors
Users online (31,265)