web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Default Attachments in...
Power Apps
Answered

Default Attachments in gallery

(0) ShareShare
ReportReport
Posted on by 725

Hi Everyone

So close but not quite

This works

 

Index(ThisItem.Attachments,1).Value

 

But this does not

 

Index(ThisItem.Attachments,ThisItem.AssetAttachIndex).Value

 

 AssetAttachIndex number is no higher than CountRows(ThisItem.Attachments)

AssetAttachIndex is a number column in Sharepoint.

So it kinda works but I am getting a red squiggly line.

 

What I am trying to do is choose which is my default attachment/image in my galley rows.

Categories:
I have the same question (0)
  • v-xiaochen-msft Profile Picture
    on at

    Hi @Corissandageri ,

     

    There is nothing wrong with the formula.

    Sometimes, there will be bugs when dynamically referencing the sp attachment column.

    Please try this workaround:

    With({temp:LookUp(LIST302,ID=ThisItem.ID,AssetAttachIndex)}, Index(ThisItem.Attachments,temp).Value)

     

    Best Regards,

    Wearsky

  • R Bakker Profile Picture
    725 on at

    Hi  v-xiaochen-msft

    Thank you for your time.

    Your formula works but but I am still getting notified that the Index function cannot be called on an empty table. I'll have another look at it later.

  • Verified answer
    v-xiaochen-msft Profile Picture
    on at

    Hi @Corissandageri ,

     

    Please try this:

    With({temp:LookUp(LIST302,ID=ThisItem.ID,AssetAttachIndex),temp2:CountRows(LookUp(LIST302,ID=ThisItem.ID).Attachments)}, If(temp<=temp2, Index(ThisItem.Attachments,temp).Value,""))

     

    Best Regards,

    Wearsky

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Leaderboard > Power Apps

#1
Kalathiya Profile Picture

Kalathiya 368 Super User 2026 Season 1

#1
Kalathiya Profile Picture

Kalathiya 368 Super User 2026 Season 1

#3
WarrenBelz Profile Picture

WarrenBelz 318 Most Valuable Professional

Last 30 days Overall leaderboard