Skip to main content

Notifications

Community site session details

Community site session details

Session Id :
Power Apps - Building Power Apps
Answered

Potential issue with Parent_Lookup inside Patch Statement

(0) ShareShare
ReportReport
Posted on by

Inside the Patch (which is inside the IF statement), the app doesn't seem to be liking the Parent_Lookup statement inside the last pair of curly braces (it runs fine without it). Does anybody have any similar experiences on suggestions for fixes? Thank you! 🙂

  • Verified answer
    jharville Profile Picture
    on at
    Re: Potential issue with Parent_Lookup inside Patch Statement

    SOLVED: The issue was that I used "ID" as a variable, when "Id" is the pre-populated variable allowed for use within PowerApps!

  • jharville Profile Picture
    on at
    Re: Potential issue with Parent_Lookup inside Patch Statement

    jharville_0-1597414565244.png

    ^^^This is the error I get when inserting the Parent_Lookup line of code.

  • jharville Profile Picture
    on at
    Re: Potential issue with Parent_Lookup inside Patch Statement
    Set(
     varRecord,
     EditForm1.LastSubmit
    );
    Navigate(
     BrowseScreen1,
     Fade
    );
    Notify(
     "Thank you for submitting this form. It has been sent to approvers for review.",
     NotificationType.Success
    );
    If(
     varRecord.FormStatus = "New",
     Patch(
     'Promo Approvals',
     Defaults('Promo Approvals'),
     {
     Title: adCouncilPicker.Selected.DisplayName,
     Approver: {
     Claims: adCouncilPicker.Selected.Claims,
     DisplayName: adCouncilPicker.Selected.DisplayName,
     Email: adCouncilPicker.Selected.Email,
     Department: "",
     JobTitle: "",
     Picture: ""
     }, Parent_Lookup: {ID: Value(varRecord.ID), Value: varRecord.ID}, Parent_ID: Value(varRecord.ID)}
     }
     )
    );

     ^^^ the Parent_Lookup line of code (4th from the bottom) is what throws the error. 

  • jharville Profile Picture
    on at
    Re: Potential issue with Parent_Lookup inside Patch Statement
    Set(
     varRecord,
     EditForm1.LastSubmit
    );
    Navigate(
     BrowseScreen1,
     Fade
    );
    Notify(
     "Thank you for submitting this form. It has been sent to approvers for review.",
     NotificationType.Success
    );
    If(
     varRecord.FormStatus = "New",
     Patch(
     'Promo Approvals',
     Defaults('Promo Approvals'),
     {
     Title: adCouncilPicker.Selected.DisplayName,
     Approver: {
     Claims: adCouncilPicker.Selected.Claims,
     DisplayName: adCouncilPicker.Selected.DisplayName,
     Email: adCouncilPicker.Selected.Email,
     Department: "",
     JobTitle: "",
     Picture: ""
     }
     }
     )
    );

     ^^^ the above portion of code runs perfectly fine without the Parent_Lookup line of code

  • mdevaney Profile Picture
    29,987 Super User 2025 Season 1 on at
    Re: Potential issue with Parent_Lookup inside Patch Statement

    @jharville 
    Please share the error message you are receiving for the red underlined code section.  This information is always gives important clues about what has gone wrong.

     

    ---
    Please click "Accept as Solution" if my post answered your question so that others may find it more quickly. If you found this post helpful consider giving it a "Thumbs Up."

     

     

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

🌸 Community Spring Festival 2025 Challenge 🌸

WIN Power Platform Community Conference 2025 tickets!

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,645 Most Valuable Professional

#2
RandyHayes Profile Picture

RandyHayes 76,287 Super User 2024 Season 1

#3
Pstork1 Profile Picture

Pstork1 65,997 Most Valuable Professional

Leaderboard