Skip to main content
Microsoft Dynamics CRM forum

How to get entity type from multitargeted entity lookup in PowerApps portal using Javascript

editSubscribe (0) ShareShare
Posted on by
We are rendering a case in powerapps portal which has a lookup of customer type(it is pointing to both account and contact). In our scenario we want to restrict a user to select account from the portal form and for that we are trying to write a javascript on change of that field and trying to get the type associated with that lookup value.
Below is the javascript we're trying to write but unfortunately we are unable to get the type.
$('#customerid').change(function () {
// Log the event to the console for debugging
console.log('Change event triggered.');
// Get the selected entities
var selectedEntities = $('#customerid_entityname').val(//);
Is there  anything wrong in the script or is their any other way to find out the type of the entity.

Helpful resources

Quick Links

New Blog Features Released!

Check out the new community blog features for viewers and authors…

Setting Up Knowledge Sources for Copilot…

Look at how configuring a comprehensive knowledge base is crucial…

Demystifying Copilot with Georg Glantschnig…

Industry experts answer burning questions directly from our amazing Community…


Andre Arnaud de Calavon Profile Picture

Andre Arnaud de Cal... 283,126 Super User

Martin Dráb Profile Picture

Martin Dráb 222,646 Super User

nmaenpaa Profile Picture

nmaenpaa 101,138

Featured topics

Product updates

Dynamics 365 release plans