Skip to main content

Notifications

Community site session details

Community site session details

Session Id :
Power Apps - Building Power Apps
Answered

The specified column is not accessible in this context

(0) ShareShare
ReportReport
Posted on by

Hi all, 

 

Bit of a strange one today. I have two dataverse tables; SupplierInvoiceHeader and SupplierInvoiceLines.

SupplierInvoiceLines has a Many-to-one relationship to SupplierInvoiceHeader and the lookup works when checking the data in dataverse directly.

 

However, when I start building a collect statement to build a collection for the gallery I get the error 'the specified column is not available in this context' before I start adding columns to filter (see attached screenshot).

 

I have tried removing and re-adding the tables, and restarting the PA editor but it keeps coming back. Any ideas?

Categories:
  • Verified answer
    kdavies1966 Profile Picture
    on at
    Re: The specified column is not accessible in this context

    Hi Rimmon,

     

    Thanks for the quick reply!

    The code was to select all of the lines for the headers that had previously been selected, and I was attempting to build the following statement;

     

    ForAll(RenameColumns(collAppHdr, "crf5f_sihidkey", "hID"),

    Collect(collApprovals, Filter(SupplierInvoiceLines, SupplierInvoiceHeader.SIHIDKey="hID))

     

    with the intention of then adding columns to bring in some additional values from the related header record.

     

    However, I decided to changetack and removed the ForAll around the collect and I was able to successfully use the following code;

     

    ClearCollect(collApprovals, AddColumns(Filter(SupplierInvoiceLines, SupplierInvoiceHeader.SIHIDKey in Distinct(collAppHDR, SIHIDKey)), "INVDisplayNotes", "N",
    "INVDeliveryContact", Project.PRAssignedto,
    "INVSalesContact", Project.PRSalesContact,
    "SIHReference", SupplierInvoiceHeader.SIHReference,
    "SIHPayTech", SupplierInvoiceHeader.BKPartner.TDSearchCode,
    "SIHStatus", SupplierInvoiceHeader.SIHStatus,
    "SIHDescription", SupplierInvoiceHeader.SIHDescription,
    "PO_IDs", PurchaseOrder.POIDKey));

  • v-mengmli-msft Profile Picture
    on at
    Re: The specified column is not accessible in this context

    Hi @kdavies1966 ,

     

    Could you please show the full formula? Including types of columns.

    It would be better to explain what you are using this formula for.

     

    Best regards,

    Rimmon

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

Understanding Microsoft Agents - Introductory Session

Confused about how agents work across the Microsoft ecosystem? Register today!

Markus Franz – Community Spotlight

We are honored to recognize Markus Franz as our April 2025 Community…

Kudos to the March Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 146,702 Most Valuable Professional

#2
RandyHayes Profile Picture

RandyHayes 76,287 Super User 2024 Season 1

#3
Pstork1 Profile Picture

Pstork1 66,015 Most Valuable Professional

Leaderboard