cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Regular Visitor

Web API: How to retrieve a record based on an alternate key with lookup field?

Hi

 

Using Web API, we are used to retrieve a record quite often with an alternate key:

{{webapiurl}}/cr23b_tmps(cr23b_string1='abc')

 

However, in this case, the alternate key is based on a lookup (e.g. accountid). Adding a lookup field in an alternate key should be possible, according to this documentation: https://docs.microsoft.com/en-us/powerapps/developer/common-data-service/define-alternate-keys-entit...

 

In Web API, I don't seem to find a right way to use the alternate key (based on lookup) in a GET request. These are some tests which did not work:

  • GET {{webapiurl}}/cr23b_tmps(cr23b_accountid=’1275227F-93A8-E911-A821-000D3ABA5555')
  • GET {{webapiurl}}/cr23b_tmps(cr23b_accountid='/accounts(1275227F-93A8-E911-A821-000D3ABA5555)')

 

Does anyone know how to do this?

 

Kind regards.

Helpful resources

Announcements
secondImage

New Return to Workplace

Reopen responsibly, monitor intelligently, and protect continuously with solutions for a safer work environment.

August 2020 CYST Challenge

Check out the winners of the recent 'Can You Solve These?' community challenge!

Experience what’s next for Power Apps

Join us for an in-depth look at the new Power Apps features and capabilities at the free Microsoft Business Applications Launch Event.

Check this Out

Helpful information

Featuring samples like Return to the Workplace and Emergency Response Applications

secondImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Users online (5,213)