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! 🙂
SOLVED: The issue was that I used "ID" as a variable, when "Id" is the pre-populated variable allowed for use within PowerApps!
^^^This is the error I get when inserting the Parent_Lookup line of code.
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.
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
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."
WarrenBelz
146,645
Most Valuable Professional
RandyHayes
76,287
Super User 2024 Season 1
Pstork1
65,997
Most Valuable Professional