cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Tamer66
Resolver I
Resolver I

List in PowerApps "has this Item an Attachment" in a Gallery

Hello,

 

i need a little help or an idea how can i show in a gallery Attachments Icon.

 

My App get connected to sharepoint Library, some items has Attachments and some Items has no attachments.

The gallery with my items works fine but additionel  i want to show in my gallery for each item an attachment icon that has an attachment

 

I have an Icon with visible showAttach

 

I try this:

If(Gallery1.Selected.'{Attachments}'.DisplayName;true;UpdateContext({showAttach:true});UpdateContext({showAttach:false})

but nothing happens.

 

Can anyone help me?

 

Thanks a lot 🙂

 

1 ACCEPTED SOLUTION

Accepted Solutions
Pstork1
Dual Super User
Dual Super User

Try doing it this way.

  1. Edit the Gallery and add an Icon to the Gallery Records
  2. Set the Visible property of the Icon object in the first Gallery record to 'If('Has attachments',true,false)'

That will display the Icon in each record where the item.hasAttachments property returns a value of true. I tested it and it works for me.



-------------------------------------------------------------------------
If I have answered your question, please mark your post as Solved.
If you like my response, please give it a Thumbs Up.

Join me at 365 and PWR EduCon in Chicago
EduCon Chicago 2022

View solution in original post

4 REPLIES 4
Pstork1
Dual Super User
Dual Super User

Try doing it this way.

  1. Edit the Gallery and add an Icon to the Gallery Records
  2. Set the Visible property of the Icon object in the first Gallery record to 'If('Has attachments',true,false)'

That will display the Icon in each record where the item.hasAttachments property returns a value of true. I tested it and it works for me.



-------------------------------------------------------------------------
If I have answered your question, please mark your post as Solved.
If you like my response, please give it a Thumbs Up.

Join me at 365 and PWR EduCon in Chicago
EduCon Chicago 2022

Hello,

I have a similar problem as Tamer66 had and I've tried solving it with your solution as i interpreted it but it doesn't seem to work, apparently there is an invalid argument issue where mine is a control type but a Boolean-value is expected instead if I translate it correctly (Swedish).

 

Could you please guide me where to solve this issue

See the screenshot attached

Tamer66
Resolver I
Resolver I

Hi @VincentGiovanni 

 

would you show in your gallery for each item that have an attachment oder not?

 

put in you gallery an icon and in the visible property try this

 

If(ThisItem.'has attachments';true;false) <-- change 'has attachmet' in swedish

 

This means if the record has an attachmet the icon visible property set as true otherwise false

 

Step2:

would you like to launch the attachmet?

Try this:

 

Launch(
First(
LookUp(
'your SP List';
ID= Thisitem.id;
).'{Attachments}'
).AbsoluteUri
)

 

I hope this helps!

 

 

Hello Again,

 

It worked perfectly, thank you very much!

Helpful resources

Announcements
October Events

Mark Your Calendars

So many events that are happening this month - don't miss out!

Ignite 2022

WHAT’S NEXT AT MICROSOFT IGNITE 2022

Explore the latest innovations, learn from product experts and partners, level up your skillset, and create connections from around the world.

Power Apps Africa Challenge 2022

Power Apps Africa Challenge

Your chance to join an engaging competition of Power Platform enthusiasts.

Top Solution Authors
Top Kudoed Authors
Users online (1,863)