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 Apps / How to redirect user t...
Power Apps
Unanswered

How to redirect user to a specific form record ID instead of the default View from SiteMap?

(0) ShareShare
ReportReport
Posted on by 1,712

Hello,

I am trying to find a way when the user clicks on the entity from the Site Map it should navigate him automatically to a specific form record ID.

For example in the field service module, we have the field service settings that take you directly to a specific form with record id as below:

 

Julien2_1-1676446053312.png

 

While adding the entity to the Site Map I know that we have the option URL and we can hardcode the App ID, Form ID, and Record ID but that won't work because the App ID and the Form ID might be changing from an environment to another when we deploy the solution.

 

powerusers.microsoft.com/.../859782

Kindly note that custom pages won't work with us, we want to open the model-driven form UI. 

  

What is the best way to achieve the above? Could you provide an example? 

Any help is greatly appreciated. 

Thank you! 

I have the same question (0)
  • AhmedSalih Profile Picture
    6,680 Moderator on at

    Hello, @Julien2, I would use Environment Variables and use RetrieveEnvironmentVariableValue Function in a Web Resource that will be triggered on the OnLoad event.

    Here is an example: 

    https://mytrial365.com/2021/03/15/get-environment-variables-value-using-javascript/

     

     

    If my reply helped you, please give a 👍 , & if it solved your issue, please 👍 & Accept it as the Solution to help other community members find it more.


    I am primarily available on weekdays from 6-10 PM CT and 5-10 PM CT on weekends.


    Visit my Blog: www.powerplatformplace.com


     

     

  • EBMRay Profile Picture
    1,712 on at

    Hello @AhmedSalih ,

     

    Thank you for your reply.

     

    How can add the JS onClick of the entity from the sitemap? OnLoad event will only work inside the form.

     

    The main goal is whenever we click on the table from the sitemap it should automatically navigate us to that page.

     

    Awaiting your response.

    Best regards,
    Julien

  • a33ik Profile Picture
    3,306 Most Valuable Professional on at

    Hello,

    I would recommend to use the following approach:

    1. Create an Html/JS webresource that will serve as a "redirector".

    2. In the code of your webresource write a JavaScript that will query for an AppId (based on the name or something like that). There is no need to do anything with FormId because it stays the same if you use solutions to move customizations between your environment.

    3. Having the AppId and FormId you can use Xrm.Navigation.navigateTo to open the right form.

    4. Embed this Html/Js webresource to your SiteMap.

     

    Good luck.

  • EBMRay Profile Picture
    1,712 on at

    Hello @a33ik ,

    Thank you for your suggestion.

     

    I'll give it a try and get back to you.

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 Launch!

Jump in, show your community spirit, and win prizes!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Congratulations to the April Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
Vish WR Profile Picture

Vish WR 421

#2
Valantis Profile Picture

Valantis 405

#3
timl Profile Picture

timl 337 Super User 2026 Season 1

Last 30 days Overall leaderboard