cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
marney
Helper II
Helper II

Gallery - Display items if value exists in Sharepoint columns

Good Morning dear people!

I have a Sharepoint list as shown below:

marney_0-1659166922475.png

 

 

The blacked out rows are the email addresses of my users; as you can see, some have a value (number) for each column (Bag, Headset etc).

In a Gallery, I will use a varUserEmail filter so that it only shows the logged in user their items.

What I would like to achieve please, that the gallery should only show items if a value exists..so the first user will see "Monitor 22" and the value, "Monitor 24" and the value etc. 

The second user wont see anything as there are no values against them in any column.

The 7th user for example, will only see "Keyboard/Mouse" and the value.

 

 

Thank you all as always.

 

1 ACCEPTED SOLUTION

Accepted Solutions

Hi @marney ,

Yes a separate entry per user would achieve the purpose in some way. If you want to exclude the blank entries the way you have if presently - more hard-coding

Filter(
   'End User Peripherals Inventory',
   YourUserMailField = varUserEmail &&
   (
      'Monitor 24' > 0 || 'Monitor 22' > 0 || Headset > 0 || . . . . 
   )
)

 

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.

Visit my blog Practical Power Apps

 

View solution in original post

4 REPLIES 4
WarrenBelz
Super User
Super User

Hi @marney ,

A bit of hard coding here - the Gallery Items

Filter(
   'End User Peripherals Inventory',
   YourUserMailField = varUserEmail
)

then a Label in the Gallery

If(
   ThisItem.'Monitor 22' > 0,
   " Monitor 22 - " & ThisItem.'Monitor 22'
) & 
If(
   ThisItem.'Monitor 24' > 0,
   " Monitor 24 - " & ThisItem.'Monitor 24'
) &
If(
   ThisItem.Headset > 0,
   " Headset - " & ThisItem.Headset
) &
. . . . . .

 

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.

Visit my blog Practical Power Apps

 

Hi @WarrenBelz,

Thank you so much for the reply...I've added that in and it shows like this (I've added the code to one label and also added an individual label for each item):

marney_0-1659169312856.png

What I would like to acheive if possible, is a gall that ends up looking like this (only showing items if a value exists for that user so some users will see a blank gallery because they don't have any items, some will see only a monitor, others will see only a bag etc).

marney_1-1659169883786.png

I suppose one way to achieve this would be to set up my SP list so that for each item, there is a separate entry per user:

 

marney_2-1659170098207.png

But with around 500 users and some users having up to 7 items (therefore 7 entries for that one user), I was really hoping to avoid doing that 🙂

Thanks again Warren,

 

Marney

 

 

 

 

Hi @marney ,

Yes a separate entry per user would achieve the purpose in some way. If you want to exclude the blank entries the way you have if presently - more hard-coding

Filter(
   'End User Peripherals Inventory',
   YourUserMailField = varUserEmail &&
   (
      'Monitor 24' > 0 || 'Monitor 22' > 0 || Headset > 0 || . . . . 
   )
)

 

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.

Visit my blog Practical Power Apps

 

Thank you Warren.

Thinking about it more, I'll be using the app to add more data to this list in the future (i.e everytime a purchase is made); having the separate entries will definitely make life a lot easier for that task too....but as always, very grateful for the time you take to respond and your knowledge.

Thanks again and have a loveluy weekend.

Cheers,

Marney

 

Helpful resources

Announcements
Power Apps News & Annoucements carousel

Power Apps News & Announcements

Keep up to date with current events and community announcements in the Power Apps community.

Community Call Conversations

Introducing the Community Calls Conversations

A great place where you can stay up to date with community calls and interact with the speakers.

Power Apps Community Blog Carousel

Power Apps Community Blog

Check out the latest Community Blog from the community!

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