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 / The column you specifi...
Power Apps
Unanswered

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
    152,855 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
    152,855 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
    152,855 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

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 759 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 310 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 228

Last 30 days Overall leaderboard