web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Pages / Portal -Execute Dynaic...
Power Pages
Answered

Portal -Execute Dynaics 365 FetchXML from entityform

(0) ShareShare
ReportReport
Posted on by 120

Hi,

 

We are trying to resolve a hopefully simple problem. We need pass the login user id to retrieve another entity record in CRM/CDS and set that as a lookup on the entityform on the load.

 

I wonder if somebody could share an example where Dynamics 365 retrieve operation is done perhaps via FetchXML in the entityform javascript and result parsed therefore lookup value set on the form?

 

Thanks

Categories:
I have the same question (0)
  • oliver.rodrigues Profile Picture
    9,482 Most Valuable Professional on at

    Hi

     

    you don't need to perform a retrieve to get the current's user id, there is a Liquid object that you can get it very easy: {{ user.id }}

     

    to set lookup value via JS you can refer to the following:

    https://community.dynamics.com/crm/f/microsoft-dynamics-crm-forum/262869/setting-value-on-lookup-field-using-javascript-in-crm-portals

     

    ------------

    If you like this post, give a Thumbs up. Where it solved your request, Mark it as a Solution to enable other users find it.

  • UmerJaved Profile Picture
    120 on at

    Hi @OliverRodrigues 

     

    As mentioned we are not trying to retrieve login user id, instead we are using that id to retrieve another entity record which needs to be setup as lookup on the current entityform on load.

    Hence my question as how we can make such call from custom JavaScript(FetchXML/ODATA?) to retrieve related entity and set that as lookup on entityform?

  • Verified answer
    OOlashyn Profile Picture
    3,498 Most Valuable Professional on at

    Hi @UmerJaved ,

     

    I wrote an article on how to dynamically filter and set data to lookup fields. Check it out - I think this approach will help you.

  • oliver.rodrigues Profile Picture
    9,482 Most Valuable Professional on at

    yes, but you need the current logged in user id to retrieve the additional records, isn't that your requirement?

    to get the id you use the liquid object I mentioned earlier

     

    then you can use that ID in your Fetch / oData

  • UmerJaved Profile Picture
    120 on at

    Thanks @OOlashyn . I'll try the link/article you suggested and come back if any questions.

  • EmployeeOcta Profile Picture
    on at

    Hi OOSYLYN,

    As per the article it's rendering as dropdown , but my query here i need to select the default value in the lookup field, which is not in this case.

     

    is there any possibility we can by default choose that.

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

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the July Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Pages

#1
Mohsin Ali Profile Picture

Mohsin Ali 33

#2
sannavajjala87 Profile Picture

sannavajjala87 28 Super User 2026 Season 2

#3
Fubar Profile Picture

Fubar 22 Super User 2026 Season 1

Last 30 days Overall leaderboard