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
Power Platform Call June 2022 768x460.png

Power Platform Community Call

Join us for the next call on August 17, 2022 at 8am PDT.

Power Platform Conf 2022 768x460.jpg

Join us for Microsoft Power Platform Conference

The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.

Users online (1,736)