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 / Potential issue with P...
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! 🙂

powerapps question.PNG
Categories:
I have the same question (0)
  • mdevaney Profile Picture
    29,991 Moderator on at

    @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."

     

     

  • jharville Profile Picture
    on at
    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

  • jharville Profile Picture
    on at
    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

    jharville_0-1597414565244.png

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

  • Verified answer
    jharville Profile Picture
    on at

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

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

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the June Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 324 Most Valuable Professional

#2
11manish Profile Picture

11manish 193

#3
Valantis Profile Picture

Valantis 138

Last 30 days Overall leaderboard