cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Helper I
Helper I

Hiding a gallary item based on sharepoint list data

Hi

 

I have a gallery with events pulled from an Outlook calendar and users can register their interest in each gallery item.

2020-01-31 17_08_53-Window.png

 

Once a user clicks register interest a patch sends the data to a SharePoint list

 

2020-01-31 17_09_11-Window.png

 

2020-01-31 17_09_45-Window.png

 

All good at this point , what I would like to do is if the user closes the form, then reopens the form, Powerapps knows that the user has already submitted their interest in the gallery item so it is set to visible = false, or the button is replaced with text.

I don't know where to start so any help, even it is tips - would be great

Thanks!

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Impactful Individual
Impactful Individual

Re: Hiding a gallary item based on sharepoint list data

Ok, So just utilize a filter with a lookup like this.
Filter('OutlookData',EventTitle <> LookUp('My Events new',EventTitle = 'OutlookData'[@EventTitle]).Eventtitle && 'Created By'.Email = User().Email )

It's basically saying, give me the records where you <> (do not) have a Lookup Match. The filter filters current record EventName and where you are the creator.

There are delegation issues here, so you may need to take both the Outlook data into a local collection if you don't already, and also do a clearcollect to collect your signed up events into a collection, then compare off those collections. Long term, if you get over 500(2000 with setting) events signed up for, you'll have to toss in some date filtering tricks to stay under delegation but hopefully by then they make date comparisons delegable!

View solution in original post

5 REPLIES 5
Highlighted
Resident Rockstar
Resident Rockstar

Re: Hiding a gallary item based on sharepoint list data

I would recommend crating a SP List for events that a user has signed up for. You would need a column for the user, a column for the event ID, etc.

Then, you can use Lookup() to see if the user has registered for that event (i.e. if there is an entry where user = User().Email and EventID = ThisItem.EventID). If so, you can make it invisible.

Highlighted
Impactful Individual
Impactful Individual

Re: Hiding a gallary item based on sharepoint list data

Ok, So just utilize a filter with a lookup like this.
Filter('OutlookData',EventTitle <> LookUp('My Events new',EventTitle = 'OutlookData'[@EventTitle]).Eventtitle && 'Created By'.Email = User().Email )

It's basically saying, give me the records where you <> (do not) have a Lookup Match. The filter filters current record EventName and where you are the creator.

There are delegation issues here, so you may need to take both the Outlook data into a local collection if you don't already, and also do a clearcollect to collect your signed up events into a collection, then compare off those collections. Long term, if you get over 500(2000 with setting) events signed up for, you'll have to toss in some date filtering tricks to stay under delegation but hopefully by then they make date comparisons delegable!

View solution in original post

Highlighted
Impactful Individual
Impactful Individual

Re: Hiding a gallary item based on sharepoint list data

Also need to consider if your eventnames are unique or not. You may need to somehow concatenate the start dates to them or something to make them unique with the names, but if you have an ID in the eventname or something this wont' be an issue.
Highlighted
Community Support
Community Support

Re: Hiding a gallary item based on sharepoint list data

Hi @surfer1978 ,

Based on the needs that you mentioned, I have made a test on my side, please take a try with the following workaround:

Set the DisplayMode property of the "Regiser Interest" button to following (disable the "Regiser Interest" button):

 

If(
   !IsBlank(
             LookUp('My Events new', 'Created By'.Email = User().Email && EventTitle = ThisItem.Subject)
   ),
   DisplayMode.Disabled,
   DisplayMode.Edit
)

 

 

or you could also consider apply a Filter formula to the Items formula of your Gallery:

Set the Items property of the Gallery to following:

Filter(
        Office365Outlook.CalendarGetItems("Calendar").value,   // replace your Gallery Items formula here
        Not(Subject in Filter('My Events new', 'Created By'.Email = User().Email).EventTitle)
)

 

Please consider take a try with above solution, check if the issue is solved.

 

Best regards, 

Community Support Team _ Kris Dai
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Highlighted
Helper I
Helper I

Re: Hiding a gallary item based on sharepoint list data

Thanks everyone for the solutions you provided. They have helped me a great deal in moving forward with this project.

 

Kind regards

Helpful resources

Announcements
secondImage

Demo-Extravaganza 2020

Check out these cool Power Apps & vote on your favorite!

secondImage

Robotic Process Automation

Let's talk about the solution provided by Microsoft for Robotic Process Automation (RPA)

secondImage

Community Highlights

Check out whats happening in Power Apps

secondImage

Community User Group Member Badges

FIll out a quick form to claim your community user group member badge today!

Top Solution Authors
Top Kudoed Authors
Users online (9,676)