Re: How to save data into lookup column dataverse through powerapps
I am going to contribute below the concept that should solve your problem and all such scenarios. You will have to adapt to your specific situation.
LookUp column type in Dataverse expects a Record value and not a Text or AutoNumber value.
When you Patch the ParentTable ('Surplus tables'), it will return you the Record information that you can store as a variable to be used later for the ChildTable ('Surplus Data')
Set(
latestRecord,
Patch(
'ParentTable',
Defaults('ParentTable'),
{ Department: txtDepartment.Text, ... ,... }
)
)
Now, when you are doing Patch for your ChildTable ('Surplus Data'), follow the concept below:
ForAll(
surpluscollection,
Patch(
'ChildTable',
Defaults('ChildTable'),
{ 'Item No.':TxtItemNo1, 'ID Surplus': latestRecord, ... , ... }
)
)
Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If this post or my previous reply was useful in other ways, please consider giving it Thumbs Up.