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

Dynamics 365 - Get URL dynamically in flow

Hi, 

 

I am using Flow with Dynamics 365 to build out a Quotes Approval Process.

In the 'Item Link' textbox on the Approvals step, I am concatenating the 'CRM tenant name' and the Quote GUID so that the user can get a link to the Quote record. (see screenshot below)

ApprovalsDyn365.png

 

  1. As you can see, I have hardcoded the Dynamics 365 URL and only the Quote GUID is dynamic.
    How can I get the Dynamics 365 URL in the flow? 
    Looking for something similar to what 'formContext.context.getClientUrl()' does in a web-resouce in Dynamics 365.
  2. When is the recommended or the best way to 'deploy' this flow to my Production tenant?

 

Thanks in advance

 

1 ACCEPTED SOLUTION

Accepted Solutions
Community Support
Community Support

Hi @Shidin

 

For your first question:

I afraid that the only way should be hardcoded the Dynamics 365 URL and I couldn't find any to get the Dynamics 365 URL in flow.

 

For your second question:

Are you creating the flow in another tenant instead of the Production tenant?You could take a try to export the flow to see if it could copy the flow to Production tenant, if not, please manually create the flow on Production tenant.

 

Best regards,

Alice

View solution in original post

4 REPLIES 4
Community Support
Community Support

Hi @Shidin

 

For your first question:

I afraid that the only way should be hardcoded the Dynamics 365 URL and I couldn't find any to get the Dynamics 365 URL in flow.

 

For your second question:

Are you creating the flow in another tenant instead of the Production tenant?You could take a try to export the flow to see if it could copy the flow to Production tenant, if not, please manually create the flow on Production tenant.

 

Best regards,

Alice

View solution in original post

For 1, What I ended up doing was adding my Dynamics instance URL as a configuration record (custom entity) and then use the 'Dynamics 365 - Get records' action to query for that particular record.

 

 

 

You can do following - 

e.g -My full link is as below, but my last underlined portion only will be dynamic.

 

https://orgf5f2b738.crm5.dynamics.com/main.aspx?appid=f9c14c95-affc-e811-a97d-000d3aa0f171&pagetype=...64cfa3e5-0c06-e911-a97f-000d3aa0f171

 

For the underlined dynamic part, Please add - Unique identifier for enetity instances from dynamic content. 

Frequent Visitor

If anyone is using the CDS Current Environment now instead of the dynamics 365.

 

The odata.id for a given record gives you the url, entity name, and ID, you would just need to parse it out.

 

Example: substring(outputs('Create_a_Copy_of_Updated_Contract_Inspection')?['body/@odata.id'], 0, indexOf(outputs('Create_a_Copy_of_Updated_Contract_Inspection')?['body/@odata.id'],'/api/'))

 

 

Replace the 'Create_a_Copy_of_Updated_Contract_Inspection'  with whatever the step name is that you want to get the URL from. That at least gives you a string that gives you the Dynamics 365 url. That being said, i'm still working on getting the entity name and ID out of there to construct a link to the actual record 😉

 

I know the CRM connector has a record url it returns, but CDS does not 😞

Helpful resources

Announcements
PP Bootcamp Carousel

Global Power Platform Bootcamp

Dive into the Power Platform stack with hands-on sessions and labs, virtually delivered to you by experts and community leaders.

secondImage

Power Platform Community Conference On Demand

Watch Nick Doelman's session from the 2020 Power Platform Community Conference on demand!

MPA Community Blog

Power Automate Community Blog

Check out the community blog page where you can find valuable learning material from community and product team members!

Top Solution Authors
Users online (10,933)