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 / Potential issue with P...
Power Apps
Unanswered

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! 🙂

Categories:
I have the same question (0)
  • mdevaney Profile Picture
    29,989 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

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

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 329 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard