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
Unanswered

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…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 717 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 329 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard