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

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Patch Lookup Column in...
Power Apps
Answered

Patch Lookup Column in Table that is Lookup on Itself

(1) ShareShare
ReportReport
Posted on by 1,387 Moderator
I have a table of "Team Members" with a "Supervisor" Column. The "Supervisor" Column is a LookUp on the same "Team Members" table.
 
In my Power App is "ColReports" Collection of Team Member records from "Team Members".
 
I am trying to Patch the "Team Members" table to give all records found in the "ColReports" Collection with a specified "Team Member" record, and I keep getting stuck.
 
Here is the latest version of my code:
 
ForAll(
    ColReports,
    Patch(
        'Team Members',
        LookUp('Team Members','Team Member ID' = ThisRecord.'Team Member ID'),
        {
            Supervisor: VarSupervisor
        }
    )
)
The "VarSupervisor" Variable stores the full Record also from the "Team Members" table.
 
The error I on "Team Members" under "Patch" says:
 
The specified column is not accessible in this context
 
This is confusing to me as "Team Members" is a table, not a column!
I have the same question (0)
  • Suggested answer
    Dominik Stalzer | primeone Profile Picture
    71 on at
    Hi.
    Try this:
    ForAll(
        ColReports, 
        Patch(
            'Team Members', 
            LookUp('Team Members', 'Team Member ID' = 'Team Member ID'), // Using the direct column reference in LookUp
            {
                Supervisor: VarSupervisor // Ensure VarSupervisor is a record type
            }
        )
    )
     
    Hope this helps
     
  • IPC_ahaas Profile Picture
    1,387 Moderator on at
    No change, I get the same error. on the line under "Patch".
     

     
    I don't know why it think it's a column.
  • IPC_ahaas Profile Picture
    1,387 Moderator on at
    So dumb, I created a new collection and it's working (ish)
     
    Figure this out Microsoft, good grief!
  • IPC_ahaas Profile Picture
    1,387 Moderator on at
    Now the error I get is on the LookUp:
     
    Error when trying to retrieve data from the network: The right side of the "Equal" operator must be a constant value.
     
  • Verified answer
    IPC_ahaas Profile Picture
    1,387 Moderator on at
    I solved this:
     
    ForAll(
        ColSupervisorReports, 
        Patch(
            'Team Members',
            LookUp('Team Members','Team Member ID' = ColSupervisorReports[@'Team Member ID']),
            {
                'Team Member ID': ThisRecord.'Team Member ID',
                Supervisor: VarSupervisor
            }
        )
    )
    The first fix was that creating a new collection because the Power App completely screwed it up.
    The second fix was using a reference to the collection in the lookup with the @.

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

#2
Kalathiya Profile Picture

Kalathiya 211 Super User 2026 Season 1

#3
VASANTH KUMAR BALMADI Profile Picture

VASANTH KUMAR BALMADI 195

Last 30 days Overall leaderboard