I have requirement where I need to create new records as well as Update records for Power Apps Form.
The primary table is called Request with many fields and many lookups. It has 2 columns called as Awarded Vendor which is a lookup and another column called as Vendor Selection Reasons which is a text field as shown:
Awarded Vendor look has relationship for the Request table as shown:
The Vendor table has following columns, Vendor Name,Amount,Remarks and Request ID which is lookup.
Objective (Power Apps Form)
In my Vendor Screen, I want to patch Vendor Table information as well as associated main Request table (Awarded Vendor (Lookup datatype) and Vendor Selection Reasons (Text datatype))
As per business requirement, I need to select 1 to 3 max vendors from patchvendor table gallery & patch Request Table i.e. Awarded Vendor and Reason for selection of Vendor as follows
For Vendor Gallery, I am using FirstN(Vendor, 3) in items property to restrict user not to enter more than 3 entries and Request Gallery, I am using First(Request, 1)
In Save Button to records in Vendor, I am using gblRecordID so I did not get duplicates as follows:
Patch( 'Requests', gblRecordID, { 'Awarded Vendor': LookUp( Vendor, 'Vendor Name' = txtAwaredVendor.Text ), 'Vendor Selection Reasons': txtVendorSelection.Text } ); Navigate( 'Cost Breakdown Screen', ScreenTransition.Cover ); Notify( "Vendors records have been submitted to the system successfully ", NotificationType.Success );
Vendor Gallery when I type some samples of vendors as follows
When I click Save button I am getting 2 entries with same vendor name
I am able unique Request ID (1040) 😊 but somehow patch is showing duplicates Its shows in Dataverse table
When I click on OnSelect next arrow button
with Patch code
Patch( 'Requests', gblRecordID, { 'Awarded Vendor': LookUp( Vendor, 'Vendor Name' = txtAwaredVendor.Text ), 'Vendor Selection Reasons': txtVendorSelection.Text } ); Navigate( 'Cost Breakdown Screen', ScreenTransition.Cover ); Notify( "Vendors records have been submitted to the system successfully ", NotificationType.Success );
, the Awarded Vendor field on Request table in Power Apps, The Awarded Vendor field is NOT displayed.
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.