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

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / The column you specifi...
Power Apps
Suggested Answer

The column you specified is not accessible in this context

(0) ShareShare
ReportReport
Posted on by 20
Hi All 
 
I'm facing a problem. 
I'm trying to get attachments of multiple records in a SharePoint list
 
My SharePoint list is named "DocList"
I have a Gallery named DocListGallery that contains 10 records of "DocList" 
 
I want to get Attachments of each of 10 records and store it on a collection named AttachmentsFilesCol 
 
Here's what i've made :
 
 
Clear(AttachmentsFilesCol);;
ForAll(
    DocListGallery.AllItems As Item;
    Collect(
        AttachmentsFilesCol;
        First(Item.Attachments)
    )
)
 
This is not working as i'm receiving an error "The specified column attachments is not accessible on this context"
The First() property is because i autorize only 1 attachment per record  so in my case i can use First. 
 
Thanks for your help because it's annoying :(
Categories:
I have the same question (0)
  • Suggested answer
    WarrenBelz Profile Picture
    153,779 Most Valuable Professional on at
    Hi @jd38,
    Try this format
    ClearCollect(
       AttachmentsFilesCol;;
       First(DocListGallery).Attachments
    )
     
    Please click Does this answer your question 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 a Like.
    MVP (Business Applications)     Visit my blog Practical Power Apps    Buy me a coffee
  • jd38 Profile Picture
    20 on at
     
    Thanks for your reply. 
    It will not resolve my issue 
     
    Your format permit just to get all the attachments of the first record DocListGallery 
     
    My need is the opposite. I want to get only 1 attachment for all DocListGallery. 
     
    Suppose you have 2 records on DocListGallery like this : 
     
    ID     |    Name         |              Type                 | Attachments
    ------------------------------------------------------------------
    01       LICUsr                  Driving License             Table[LicenceScreenshoot.png]
    -------------------------------------------------------------------
    02       StandX                 Stand location              Table[Stand.png]
     
     
    On those 2 records, i need to get the attachments to show it on a grid
     
     

    In order to get Attachments and store it in a collection.
     
    Clear(AttachmentsFilesCol);;
    ForAll(
        DocListGallery.AllItems As Item;
        Collect(
            AttachmentsFilesCol;
            First(Item.Attachments)
        )
    )
     
    This code is not working. 
     
    I've also tried 
     
    Clear(AttachmentsFilesCol);;
    ForAll(
        DocListGallery.AllItems As Item;
        Collect(
            AttachmentsFilesCol;
            {Attachments : Item.Attachments}
        )
    )
     
    Not working
     
  • WarrenBelz Profile Picture
    153,779 Most Valuable Professional on at
    Hi @jd38
    Yes you are correct (my brain not properly engaged at the time). This does not help you however as when List records are collected, the Attachments field is presented as a BLOB (Binary Large Object) reference as below (try to collect a complete list and you will see this)
    and you cannot dissect it further into its individual files (hence the message that the field is not available to do what you need).  When you refer to a single record (as in the code I provided), it sees Attachments as the Table and successfully resolves that field into its components. While what you have could be argued as possibly technically correct, it simply does not work - I have tried a number of iterations without success (getting the same message).
    For instance, this works (as maybe you can do this 10 times)
    Clear(AttachmentsFilesCol);;
    Collect(
       AttachmentsFilesCol;
       First(
          Index(
             DocListGallery.AllItems;
             1
          ).Attachments
       )
    );;
    Collect(
       AttachmentsFilesCol;
       First(
          Index(
             DocListGallery.AllItems;
             2
          ).Attachments
       )
    );;
    Collect(
       AttachmentsFilesCol;
       First(
          Index(
             DocListGallery.AllItems;
             3
          ).Attachments
       )
    )

    however the logical progression using Sequence of the gallery rows
    Clear(AttachmentsFilesCol);;
    ForAll(
       Sequence(
          CountRows(DocListGallery.AllItems);
          Collect(
             AttachmentsFilesCol;
             First(
                Index(
                   DocListGallery.AllItems;
                   Value
                ).Attachments
             )
          )
       )
    )

    immediately gets the same message you are receiving.
     
    Please click Does this answer your question 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 a Like.
    MVP (Business Applications)    Visit my blog Practical Power Apps    Buy me a coffee
  • WarrenBelz Profile Picture
    153,779 Most Valuable Professional on at
    Hi @jd38,
    A quick follow-up to see if you received the answer you were looking for or if you need further assistance.
     
    Please click Does this answer your question 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 a Like.
    MVP (Business Applications)    Visit my blog Practical Power Apps   

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 101 Most Valuable Professional

#2
Haque Profile Picture

Haque 81

#3
VASANTH KUMAR BALMADI Profile Picture

VASANTH KUMAR BALMADI 70

Last 30 days Overall leaderboard