Skip to content

Benjamin John Posts

EntitySetName Bookmarklet

Posted in Dynamics 365, Power Automation, and Power Platform

Almost six years after my last post about bookmarklets, I’m proud to present you a new bookmarklet for Dynamics 365 CE.

It can be used to retrieve the EntitySetName for for an entity (table).

In case you don’t know what the EntitySetName, here is what Microsoft writes about it.

This value is used in the resource path for this entity in the Web API. For custom entities, you can change the name of the entity set used. By default it is the same as the LogicalCollectionName.

Source: Microsoft Docs

In other words, you need when you use the WebApi or the Common Data Service (current environment) connector in PowerAutomate.

The EntitySetName Bookmarklet

Create a normal bookmark in you browser and replace its url with the following code:

javascript: etn=prompt("SchemaName?","account");var xhr=new XMLHttpRequest;xhr.open("GET","/api/data/v9.0/EntityDefinitions(LogicalName='"+etn+"')?$select=EntitySetName",!0),xhr.onload=function(t){4===xhr.readyState&&200===xhr.status&&prompt("EntitySetName:",JSON.parse(xhr.responseText).EntitySetName)},xhr.send();

You can use it at any place inside of D365 CE. You only need to write in the SchemaName of an entity (table) and it answers you with the EntitySetName from the EntityDefinitions.

Limit ClickDimensions star rating

Posted in ClickDimensions, Dynamics 365, and Power Platform

The ClickDimensions star rating has by default 10 options .

Here is how you can limit the star rating options only with CSS if you don’t need all options.

Limit star rating

Limit all star ratings in a survey

Paste the following in the code editor of the survey and customize the number of stars you want to have to limit the options all star ratings.

:root {
  --number-of-stars: 3;
}

#clickdimensionsForm div[id^='stars-wrapper'] {
  max-width: calc(207px - (191px - (var(--number-of-stars) * 16px)))
}

Limit a single star rating in a survey

Paste the following in the code editor of the survey and customize the number of stars you want to have and use the ID of the desired star rating to limit the options.

:root {
  --number-of-stars: 3;
}

#stars-wrapper-f_f6e0ec97b339e911a838000d3ab0d281 {
  max-width: calc(207px - (191px - (var(--number-of-stars) * 16px)))
}
Find ID to limit star rating
The ID of a survey question will change if you do not transport them with the ClickDimensions Export/Import

Display the plain text version of an email on Windows

Posted in ClickDimensions, Dynamics 365, Dynamics 365 Marketing, and Power Platform

Today I had the challenge to display the plain text version of an email on a Windows device. I gave the Outlook setting “Read all standard mail in plain text” in the Trust Center a try, but it only removes the images and formatting from the the HTML version of the email.

Finally I found in the internet that Thunderbird is able to show the text version of a mailing.
Here is the way to switch the view.

plain text version of an email

And this is of course also helpful for plain text emails with Dynamics 365 Marketing.

Get CRM URL in Power Automate

Posted in Dynamics 365, Power Automation, and Power Platform

Sometimes you need to work with the URL of your CRM within Power Automate, for example:

  • to relate or unrelate two records with the Common Data Service (current environment) connector
    CDS (current) - Relate Records Action
  • or writing an email with a hyperlink to a record.

If you have a multi-staged environment and you build your Flow solution aware, you don’t want to update your static URLs after each transport.

Solution

‘Recycle’ the OData Id from a previous CDS action.

URL in OData Id of a Flow
  1. We need an previous CDS action that has an OData Id within its output (like shown above).
    If you have no action like this, consider to create a “List records” action which is limited to 1 by the “Top count” option.
  2. Create a “Compose” action and give it the OData_Id as input.
  3. Create an other “Compose” action and give it following expression to receive the CRM URL.
    concat(join(take(split(outputs('OData_Id'), '/'), 3), '/'), '/')
  4. Create an other “Compose” action and give it following expression to receive the OData URL.
    concat(join(take(split(outputs('OData_Id'), '/'), 6), '/'), '/')
Compose URL in Flow

How it works

  • concat(join(take(split(outputs('OData_Id'), '/'), 3), '/'), '/')
    Contains the OData Id we’ve stored in the first “Compose” action.
    "https://yourcrm.crm4.dynamics.com/api/data/v9.1/cdi_postedform(792189BA-BA04-E711-80F6-C4346BAC4DDC)"

  • concat(join(take(split(outputs('OData_Id'), '/'), 3), '/'), '/')
    Cuts the URL string in separate substring wherever a slash (‘/’) is.
    0: "https:"
    1: ""
    2: "yourcrm.crm4.dynamics.com"
    3: "api"
    4: "data"
    5: "v9.1"
    6: "cdi_postedform(792189BA-BA04-E711-80F6-C4346BAC4DDC)"

  • concat(join(take(split(outputs('OData_Id'), '/'), 3), '/'), '/')
    Merge the first 3 entries of the splitted URL to a new array.
    0: "https:"
    1: ""
    2: "yourcrm.crm4.dynamics.com"

  • concat(join(take(split(outputs('OData_Id'), '/'), 3), '/'), '/')
    Merge the new array into a string and separate the entries by a slash (‘/’).
    "https://yourcrm.crm4.dynamics.com" 

  • concat(join(take(split(outputs('OData_Id'), '/'), 3), '/'), '/')
    Create a new string with the merged URL and put a slash (‘/’) at its end.
    "https://yourcrm.crm4.dynamics.com/" 

In the same way you receive the OData URL when you “take” the first 6 elements instead of the first 3 elements.