web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Patch with different t...
Power Apps
Unanswered

Patch with different tables

(0) ShareShare
ReportReport
Posted on by 416

 

@v-xiaochen-msft  @v-yutliu-msft @v-yubily @v-xida-msft  

 

Hi All,

 

Dataverse table structure

  • 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:

    aaroh_bits_0-1613728821015.jpeg

     

    aaroh_bits_1-1613728821024.jpeg

     



  • Awarded Vendor look has relationship for the Request table as shown:

    aaroh_bits_2-1613728821030.jpeg

     

    aaroh_bits_3-1613728821035.jpeg

     



  • The Vendor table has following columns, Vendor Name, Amount, Remarks and Request ID which is lookup.
    aaroh_bits_4-1613728821039.jpeg

     

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 patch vendor table gallery & patch Request Table i.e. Awarded Vendor and Reason for selection of Vendor  as follows

    aaroh_bits_5-1613728821049.jpeg

     



  • 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)



    aaroh_bits_6-1613728821057.jpeg

     



    aaroh_bits_7-1613728821066.jpeg
  • 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
    );



    aaroh_bits_8-1613728821072.jpeg

     

  • Vendor Gallery when I type some samples of vendors   as follows

    aaroh_bits_9-1613728821079.jpeg

     

  • When I click Save button I am getting 2 entries with same vendor name

    aaroh_bits_10-1613728821086.jpeg

     



  • I am able unique Request ID (1040)  😊 but somehow patch is showing duplicates  Its shows in Dataverse table
    aaroh_bits_11-1613728821089.jpeg

     

  • When I click on OnSelect next arrow button

    aaroh_bits_12-1613728821094.jpeg

     



    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
    );


  • aaroh_bits_13-1613728821097.png

     


    , the Awarded Vendor field on Request table in Power Apps, The Awarded Vendor field is NOT displayed.



    aaroh_bits_14-1613728821101.jpeg
  • Add Vendor button patch code (to add new vendor)is as follows:
    Patch(
    Vendor,
    Defaults(Vendor),
    {
    'Purchase Request': gblRecordID,
    'Vendor Name': "",
    Amount: 0,
    Remarks: ""
    }
    );
    Refresh(Vendor);

    aaroh_bits_15-1613728821107.jpeg

     


    What I need that user is able to select 1 to 3 vendors with unique request ID from Vendor Gallery and able to save Awarded vendor.    

    I referred to this issues asked by someone else in past for different data sources. 

    https://powerusers.microsoft.com/t5/Building-Power-Apps/Patch-to-2-Dfferent-Data-Sources/m-p/30248#
    Any help would be greatly appreciated.

Categories:
I have the same question (0)

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

Season of Sharing Community Challenge Launch!

Jump in, show your community spirit, and win prizes!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the May Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
Valantis Profile Picture

Valantis 421

#2
WarrenBelz Profile Picture

WarrenBelz 345 Most Valuable Professional

#3
Kalathiya Profile Picture

Kalathiya 278 Super User 2026 Season 1

Last 30 days Overall leaderboard