cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
tianaranjo
Level 8

Checking to see if a Record exists, if it does then Patch an update, if not then create a new record

I have the following scenario:

2 SharePoint Lists, 3 collections, 1 gallery, UserId stored in a variable

SharePoint lists

  1. MeetingSessions
  2. SessionRegistrations

Collections 

  1. colMeetingSessions 
  2. colSessionRegistrations
  3. colMySessions =
    ClearCollect(
    colMySessions, Filter(colSessionRegistration, UserBid = gloThisUserId)

glrAgenda:  

  • Items = colMeetingSessions  (One of the columns is SessionCode, ex. "StrDev_1")
    • Within this gallery is an '+' icon 

Scenario:

When a user selects the '+' icon I wish to patch the SessionRegistration list
    If 

  • gloUserId && SessionCode NOT already in SessionRegistration &&
  • 30 or less people signed up for that session

I have tried numerous formulas without success.  

1 ACCEPTED SOLUTION

Accepted Solutions
Super User
Super User

Re: : Checking to see if a Record exists, if it does then Patch an update, if not then create a new

Hi @tianaranjo,

Maybe the attached helps.

registrationApp.gif

View solution in original post

5 REPLIES 5
Community Support Team
Community Support Team

Re: Checking to see if a Record exists, if it does then Patch an update, if not then create a new re

Hi @tianaranjo,

 

How would you define the 30 or less people signed up for that session? Using which column in colMeetingSessions? I think it would be better if you could share some data examples for all the involved data sources in this app. Some screenshots would also help. Do mask sensitive data before uploading.

 

Regards,

Mona

Community Support Team _ Mona Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
tianaranjo
Level 8

: Checking to see if a Record exists, if it does then Patch an update, if not then create a new re

Updated - in original photo, i said sessionId sessionCode.  It was meant to be does not equal. 

Basically, only patch if the user is has not already registered for the selected session. I do not want to allow a user to duplicate signing up for a session and I need to stop allowing users to sign up for a session once 30 people sign up.

 

@v-monli-msft Thanks for your reply.  I hope the screen shots help.  
How would you define the 30 or less people signed up for that session?
Using which column in 
colMeetingSessions? Meeting Sessions is not being referenced for the count.
 

MeetingSession is only for the collection displaying all the sessions for the meeting and is not being updated or patched.. 

The column being referenced will come from the colSessionRegistration, count UserBid IF the SessionCode from the glrAgenda.Selected.SessionCode (items = colMeetingSession) is equal to the colSessionRegistration.SessionId.

 

image.png

 

Super User
Super User

Re: : Checking to see if a Record exists, if it does then Patch an update, if not then create a new

Hi @tianaranjo,

Maybe the attached helps.

registrationApp.gif

View solution in original post

tianaranjo
Level 8

Re: : Checking to see if a Record exists, if it does then Patch an update, if not then create a new

Awesome; thanks @ericonline

Super User
Super User

Re: : Checking to see if a Record exists, if it does then Patch an update, if not then create a new

Anytime!

Helpful resources

Announcements
thirdimage

Power Automate Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

sixthImage

Power Platform World Tour

Find out where you can attend!

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

fifthimage

Microsoft Learn

Learn how to build the business apps that you need.

Top Kudoed Authors
Users Online
Currently online: 231 members 5,047 guests
Please welcome our newest community members: