cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Microsoft
Microsoft

Filtering data from two tables

I have two tables:

 

Table 1: id, Name, Title, URL

Table 2: Table1.id, viewed_by_email_address (stored from User().Email), date 

 

I'm trying to create a Filter in a Gallery that will allow someone to hide "previously viewed". I've been reading the forums and can't quite figure it out. 

 

something like: if toggle3 = true, filter(table1) ... when there is a record in table2 that table1.id = User().Email 

 

 

 

 

 

1 ACCEPTED SOLUTION

Accepted Solutions
Community Support
Community Support

Hi @morall ,

Do you store the "previously viewed" records in your Table 2?

Do you want to filter out these "previously viewed" records from your Table1 when the Toggle button is checked?

 

Based on the needs that you mentioned, I think the Filter function could achieve your needs. Please consider take a try with the following workaround:

Set the Items property of the Gallery to following:

Filter(
       Table1,
       If(
           Toggle3.Value = true,
           Not(id in Filter(Table2, viewed_by_email_address = User().Email).id),
           true
       )
)

or

If(
   Toggle3.Value = true,
   Filter(
          Table1,
          Not(id in Filter(Table2, viewed_by_email_address = User().Email).id)
   ),
   Table1
)

 

Please consider take a try with above solution, then 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.

View solution in original post

6 REPLIES 6
Super User III
Super User III

Hi @morall ,

I cannot test this, but I believe it would be something like

Filter(
   Table1,
   id <> 
   LookUp(
      Table2,
      viewed_by_email_address = User().Email
   ).Table1.id
)

OR

Filter(
   Table1,
   id = 
   LookUp(
      Table2,
      viewed_by_email_address <> User().Email
   ).Table1.id
)

 

Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

Community Support
Community Support

Hi @morall ,

Do you store the "previously viewed" records in your Table 2?

Do you want to filter out these "previously viewed" records from your Table1 when the Toggle button is checked?

 

Based on the needs that you mentioned, I think the Filter function could achieve your needs. Please consider take a try with the following workaround:

Set the Items property of the Gallery to following:

Filter(
       Table1,
       If(
           Toggle3.Value = true,
           Not(id in Filter(Table2, viewed_by_email_address = User().Email).id),
           true
       )
)

or

If(
   Toggle3.Value = true,
   Filter(
          Table1,
          Not(id in Filter(Table2, viewed_by_email_address = User().Email).id)
   ),
   Table1
)

 

Please consider take a try with above solution, then 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.

View solution in original post

Hi @morall ,

A coupe of options for you - please tag whoever you want to continue the thread with.

Hey Warren, 

 

Thanks! I'll give the above answer a shot and see if it works! 

Hi @morall ,

Sure, please take a try with the solution I provided above, check if it could help in your scenario. If you have any issue with it, please feel free to let me know here.

 

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.

this works, thank you!

 

However I'm getting a Delegation warning. Do I need to change something in the data source to get rid of this warning? I'm pulling data from entities. 

 

Screen Shot 2020-07-05 at 4.04.13 PM.png

Helpful resources

Announcements
New Badges

New Solution Badges!

Check out our new profile badges recognizing authored solutions!

New Power Super Users

Congratulations!

We are excited to announce the Power Apps Super Users!

Power Apps Community Call

Power Apps Community Call: February

Did you miss the call? Check out the Power Apps Community Call here.

Microsoft Ignite

Microsoft Ignite

Join digitally, March 2–4, 2021 to explore new tech that's ready to implement. Experience the keynote in mixed reality through AltspaceVR!

Top Solution Authors
Top Kudoed Authors
Users online (52,492)