cancel
Showing results for 
Search instead for 
Did you mean: 

Dynamic record URL attribute not present in flow

Unlile the OOB worklfow in D365 where we can provide a  link to the record using Record URL attribute. In microsoft flow, im not able to locate the respective attribute to be added as 'item link' in start an approval step connector .

When instead there is a placeholder to provide item link, the attribute is missing. 

Its definitely a good to have feature esp in case of approval flows, teh user can go directly to the record in question instead of navigating to the entity record via CRM web app which is not effective.

Status: New
Comments
Microsoft

As a workaround, you can append the URL to the Id of the record to create a link.  You can get the current environment URL by using a Parse JSON action and then setting a variable for the URL to:

uriHost(body('Parse_JSON_to_get_execution_context')?['@odata.context'])

 

D365 link to URL.jpg

 

 

 
Anonymous
Not applicable

I'm interested in your work around to get url into a flow, but I need more detail.   How are you configuring the PARSE JSON step?  Content and Schema?

Microsoft

You basically need to generate the URL 

Org URL + /main.aspx?pagetype=entityrecord&etn= + entity name + &id= + record GUID

 

Now there could be additional options with the CDS connector to tell how we want the URL to be built

  1. Include app context
    1. By providing an app id
    2. By deducting the app context:
  1. If the Flow is triggered on-demand from the user interface, maybe the appId can be passed in the context
  2. Otherwise try to open the URL in the context of the default app for the user (i.e. the only have they have access to, or the most recent app they have used).
  1. Specify a form GUID (&formid=),
  2. Enable or disable navigation (&navbar=off),
  3. Enable or disable command bar (&cmdbar=false)
Anonymous
Not applicable

Is there an example you know of out here?  I don't know how this all fits together.

Microsoft

You basically need to generate the URL.  In order to generate the URL, you need to provide the components below (org URL, entity name, record GUID.

Org URL + /main.aspx?pagetype=entityrecord&etn= + entity name + &id= + record GUID  OR

Org URL + /main.aspx?appid= +PowerApp id + &pagetype=entityrecord&etn= + entity name + &id= + record GUID  (if you want to drive users to a particular app)

 

Now there could be additional options with the CDS connector to tell how we want the URL to be built

  1. Include app context
    1. By providing an app id
    2. By deducting the app context:
  1. If the Flow is triggered on-demand from the user interface, maybe the appId can be passed in the context
  2. Otherwise try to open the URL in the context of the default app for the user (i.e. the only have they have access to, or the most recent app they have used).
  1. Specify a form GUID (&formid=),
  2. Enable or disable navigation (&navbar=off),
  3. Enable or disable command bar (&cmdbar=false)

I triggered my test flow on the creation of a record in CDS using the Common Data Service (current environment) connector (which is only available if you create the flow from a solution).  This connection did not return the odata for the URL so I added a step to get the same record.  Then I parsed the JSON from the get a record step.  Then I build the URL in the email body using the HTML text editor.  The output in the body is from the Compose step in the Flow.

 
 
 

email.jpg

 

flow1.jpg

flow2.jpg

 

The Parse Json step uses the "body" field from the Get a record step and this JSON:

{
    "type""object",
    "properties": {
        "@@odata.context": {
            "type""string"
        },
        "value": {
            "type""array",
            "items": {
                "type""object",
                "properties": {
                    "@@odata.etag": {
                        "type""string"
                    },
                    "systemuserid": {
                        "type""string"
                    },
                    "internalemailaddress": {
                        "type""string"
                    },
                    "lastname": {
                        "type""string"
                    },
                    "firstname": {
                        "type""string"
                    },
                    "ownerid": {
                        "type""string"
                    }
                },
                "required": [
                    "systemuserid"
                ]
            }
        }
    }
}
 
The Compose Step uses the URIhost function as mentioned above where Parse_Json is referencing the parse step.
uriHost(body('Parse_JSON')?['@odata.context'])
 
Hope that helps!
Correna
 
Anonymous
Not applicable

And what is this step:

uriHost(body('Parse_JSON_to_get_execution_context')?['@odata.context'])

 

Do I paste that exactly as is, or am I supposed to replace the string in parenthesis with something?

Microsoft

@Anonymous , 'Parse_JSON_to_get_execution_context')?['@odata.context'] is the a dynamic field from the step above it.  Hope that helps!