cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
bs-dev001
Advocate I
Advocate I

[Dataverse Web API] Upsert with string external key will fail

Hi All,

We are looking to use Dataverse Web API to upsert external data into Dataverse and through our research we found that if the external key field is string type, the upsert fails.  Has anyone in the community encountered the same issue?

 

* PATCH {DataverseWebAPI}/api/data/v9.2/new_table1(new_external_id_string=ABC12345)
-> This will throw an exception.

* PATCH {DataverseWebAPI}/api/data/v9.2/new_table1(new_external_id_integer=12345)
-> This will succesfully upsert the record.

 

There is no mention in the documentation that external key with string type will fail (https://docs.microsoft.com/en-us/power-apps/developer/data-platform/webapi/update-delete-entities-us...)
We ended up creating an integer external key field in a Dataverse table and also changing the external key format on external data to be integer type.  This is very cumbersome as we are looking to integrate our old system to Power Platform and we have at least 10 external data sources we plan to integrate to Dataverse. 

1 ACCEPTED SOLUTION

Accepted Solutions
rampprakash
Super User
Super User

Hi @bs-dev001 

 

Did you tried passing with single quotes?

 

{DataverseWebAPI}/api/data/v9.2/new_table1(new_external_id_string='ABC12345')

 

Please mark as Answer if it is helpful and provide Kudos

Subscribe : https://www.youtube.com/channel/UCnGNN3hdlKBOr6PXotskNLA

Blog : https://microsoftcrmtechie.blogspot.com

View solution in original post

3 REPLIES 3
rampprakash
Super User
Super User

Hi @bs-dev001 

 

Did you tried passing with single quotes?

 

{DataverseWebAPI}/api/data/v9.2/new_table1(new_external_id_string='ABC12345')

 

Please mark as Answer if it is helpful and provide Kudos

Subscribe : https://www.youtube.com/channel/UCnGNN3hdlKBOr6PXotskNLA

Blog : https://microsoftcrmtechie.blogspot.com

@rampprakash thank you for your reply and adding single quotes worked like a charm.  Just out of my curiosity, is this mentioned in documentations? 

Hi @bs-dev001 

 

Its an OOB Behavior of the WebApi.

Helpful resources

Announcements
October Events

Mark Your Calendars

So many events that are happening this month - don't miss out!

Ignite 2022

WHAT’S NEXT AT MICROSOFT IGNITE 2022

Explore the latest innovations, learn from product experts and partners, level up your skillset, and create connections from around the world.

Power Apps Africa Challenge 2022

Power Apps Africa Challenge

Your chance to join an engaging competition of Power Platform enthusiasts.

Users online (2,706)