Skip to main content

Notifications

Announcements

No record found.

Small and medium business | Business Central, N...
Suggested answer

Update Sales Header in Power Automate failed: 1 of 2 keys provided for lookup, provide keys for...

(3) ShareShare
ReportReport
Posted on by 10
We need to update the BC Sales Header data (Document Date, Package Tracking No.) using Power Automate.
We have created an API Page to expose the required fields from the Sales Header table, part of the source code is shown below.

 
In Power Automate, firstly, we leveraged the filter query in the /Find records (V3)/ connector to find the target record.

 
After that, we used the /Update record (V3)/ connector to update the corresponding columns (defined in the API Page) of the target record, however, the update connector failed with the error: /1 of 2 keys provided for lookup, provide keys for only DocumentType,No./

 
We also tried the /Get record (V3)/ connector, which resulted in the same error.

 
In the connectors, we are using the /Row id/ to specify the corresponding record, which was retrieved from the /Find records (V3) connector, however, the error details reveal that we need to specify the primary key (DocumentType and No.) of the Sales Header record. But there is nowhere we can enter the primary key value in the connectors.
 
So my question is, is the /Update Record (V3)/ connector capable of updating data in the Sales Order table?
What is the reason and how to fix the /1 of 2 keys provided for lookup, provide keys for only DocumentType,No./ problem?
Please help & Thank you!
  • Suggested answer
    YUN ZHU Profile Picture
    YUN ZHU 75,942 Super User 2024 Season 2 on at
    Update Sales Header in Power Automate failed: 1 of 2 keys provided for lookup, provide keys for...
    Hi, please try the same as the standard API, using the "Sales Order Entity Buffer" table instead of the Sales Header. This should solve the problem. 
     
    PS: It is recommended to directly copy the code of this standard page, then delete the unnecessary parts and add the fields you need.
     
     
    Hope this helps.
    Thanks.
    ZHU
  • seanyu Profile Picture
    seanyu 10 on at
    Update Sales Header in Power Automate failed: 1 of 2 keys provided for lookup, provide keys for...
    Hi Mohamed,
     
    Thank you for the information.
    I was using the "Row id", which is exactly the System id acquired from the previous find record action.
    As described in my original post, passing the row id to the Get record or Update record connector did not work.
     
  • Suggested answer
    Mohamed Amine Mahmoudi Profile Picture
    Mohamed Amine Mahmoudi 10,863 Super User 2024 Season 2 on at
    Update Sales Header in Power Automate failed: 1 of 2 keys provided for lookup, provide keys for...
    Hi,
     
    In Power Automate you must use the System ID to identify the rows not the primary keys insted BC.
     
     
     
    Best regards,
    Mohamed Amine MAHMOUDI

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

Congratulations 2024 Spotlight Honorees

Kudos to all of our 2024 community stars! 🎉

Meet the Top 10 leaders for December

Congratulations to our December super stars! 🥳

Start Your Super User Journey

Join the ranks of our community heros! 🦹

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,784 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,476 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans