cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Andrew7345
Frequent Visitor

Patching parent, child record error

Hi,

 

I'm trying to patch parent/ child tables in single onselect event, like this

 

ClearCollect(
colEmployee,
Patch(
Employees,
{Employee:Blank()},
{'FIRST NAME':"Test patch"}
)
);
ClearCollect(
colEmployeeChanges,
Patch(
Employee_Changes,
{Employee_Change:Blank()},
{Employee:First(colEmployee).Employee},
{REQUESTOR:"Test patch"}
)
)

 

The error is saying that the expected type of argument is record while a guid is supplied instead.

 

The error refers to this line  {Employee:First(colEmployee).Employee}, 

 

Employee is lookup column in Employee_Changes tabe to an Employee table.

 

Could someone please advice id there's a way to convert types  or to do something similar to fix the issue.

 

Thanks!

1 REPLY 1
rampprakash
Super User
Super User

Hello @Andrew7345,

 

If you are sure that {Employee:First(colEmployee).Employee} this Line is throwing error then you can try changing the same like below to make it work

 

{Employee:LookUp(EMPLOYEETABLENAME,'FIELD FROM EMPLOYEE'=VALUE FROM COLLECTION)}

 

Please mark as Answer if it is helpful and provide Kudos


Subscribe : https://www.youtube.com/channel/UCnGNN3hdlKBOr6PXotskNLA
Blog : https://microsoftcrmtechie.blogspot.com

 

 

Helpful resources

Announcements
Power Platform Conf 2022 768x460.jpg

Join us for Microsoft Power Platform Conference

The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.

PA Virtual Workshop Carousel 768x460.png

Register for a Free Workshop

This training provides practical hands-on experience in creating Power Apps solutions in a full-day of instructor-led App creation workshop.

PA.JPG

New Release Planning Portal (Preview)

Check out our new release planning portal, an interactive way to plan and prepare for upcoming features in Power Platform.

Users online (3,081)