Uncategorized

Community Contributions Tracker

 

For all of those aspiring MVP’s out there, now available in the Power Platform Bank a set of files including a solution for the entities required in CDS, an excel spreadsheet for the contribution type data and a Canvas App to manage your contributions.

Full instruction video available on YouTube

Full details on my blog

Don’t hesitate to test, comment, share, request / recommend improvements!!

Keep on Diving!

 

Embedded canvas app how to get the selected (Polymorphic) lookup field value

Problem : within Embedded Canvas app we know how to get text field values but how to retrieve the (polymorphic) Lookup values.

Analysis:

Before me jotting down the solution, I would like to elaborate what is Polymorphic lookup?

Polymorphic Lookups are the lookups which can refer to a record from any entity in a set. Owner field in any entity is a classic example which refers to both User and Teams entities.

Why is it important to know if it is polymorphic lookup or not to retrieve the lookup value in embedded canvas app?

Well, because if the lookup refers to more than one entity then the name (schema) of the fields which we want to retrieve varies by entity. In above mentioned Owner example, if we want to retrieve name value from the Owner field. In Teams entity Name field is called as Team Name, whereas in User entity Name field is called as Full Name.

Powerapp doesn’t know which entity Name value we want to retrieve, so we have to be specific in this case.

Solution:

In Contact entity if we want to retrieve Company Name field value and display in a canvas app. Company name refers to both Contacts and Accounts entity. So in our formulae we have to be specific about which entity values are we interested in.

Following formulae retrieves Name field from Company Name Lookup by checking the condition.

If Entity type is Accounts then it retrieves Account Name, if Entity type is Contacts then it retrieves Full Name field.

If(IsType( [@ModelDrivenFormIntegration].Item.’Company Name’, [@Accounts] ),
AsType([@ModelDrivenFormIntegration].Item.’Company Name’, [@Accounts] ).’Account Name’,
AsType( [@ModelDrivenFormIntegration].Item.’Company Name’, [@Contacts] ).’Full Name’ )

Regards,

Pavan Kumar Garlapati

Card vs List: Reflow concept in Dynamics 365 explained

Reflowing to either card or list form is another way to control how we want to present information in Unified Interface. To read more about reflowing, please click this link.

This property applies to read-only list views and sub-grids. 

So, a list form in Unified Interface looks like this:

And a grid looks like this:

In Unified Interface, a reflow concept was introduced. It is where the information will be displayed as a “card form” when the space available is not enough to display the columns of the sub-grid. For example:

Below on my Account Form, you can see that my related contacts sub-grid is displayed in the card form.

Now if I go to see the settings in my form designer, you can see that the width of the third column where the contact sub-grid is displayed is set to occupy 25% of the whole space.

If I increase the space occupied by the 33% or 1/3 of the whole space, let’s see what happens:

When I hit publish and refresh my UCI form, the sub-grid automatically “reflows” to the grid form.

So it seems like it the grid would reflow to card form once space occupied is not enough for the whole information on the grid to be displayed.

But if you wish to have more control in the reflow behaviour of your app, you can go to the controls settings and specify how you want the information to be displayed.

In your grid editor, select the Controls tab and then select Add Control

add control

Select Read Only Grid

read-only

Select which client you’d want this control to be applied to, then select the pencil icon to control the behaviour.

properties

You can define how you want your data to be displayed, you can choose from 3 choices

  • Reflow – the grid will “reflow” to card form once there is not enough space
  • Grid only – data will be displayed in grid form only.
  • List only – data will be displayed in card form only.

bind

If you’re selecting reflow or list only, you can define which card form you’d like to use.

card

You can customize how you want the information to be displayed in your card form by creating a form with type “card”.

card form

The data will be displayed like this:

card details

Once it is published, you can now control how you want your lists to be displayed in Dynamics 365. I use it often on Classic Dashboards and sub-grids within forms. Here are some examples 🙂

account
Here I used it to control how I wanted to display the sub-grids in my main Account form. In my opinion, the card form looks much cleaner in this scenario 🙂
dashboard
This time, I used it to control how I want the data to be displayed on my dashboard. All Accounts is displayed as card form while Active Accounts is displayed in grid form.

Mobile customization with iPad

If you are using an iPad and Safari to open Microsoft Dynamics 365 CE environments you may know, that in classic web UI, the settings tab has not been shown and also in the new UI the option to open the advanced settings window is not shown. Trying to open a copied link to the advanced settings is showing an error.

But – if you are browsing to make.powerapps.com on your iPad, you can select your Dynamics 365 CE environment and all supported customization options of the PowerPlatform are available.
Editing views, forms and dashboards in CE and model-driven apps and also building canvas apps and flows is working.

Using Google Chrome persons / profiles

The following tip might be useful for you, if

  • you are using Microsoft Demos or,
  • you are already working with several O365 / D365 tenants or,
  • you need to log-in with different user profiles simultaneously in MSDyn365CE or PowerPlatform to customize and test.

In many cases the private browser / guest user is used or the current user will be logged out, the browser will be closed or the cache will be cleared. But there is an easy way to use several logins, when you can use Google Chrome. In this case you can use different chrome persons (profiles).

To create a new person, click on the person icon in the top right corner and then select “Manage people” and then “Add person”. In the following step you can select an avatar and give the chrome person a specific name e.g. the name of the tenant or the username /role you want to use in this chrome browser.

To switch between the chrome browser instances, you need to click on the person icon in the top right corner and then select the one you want to use. The new person will start in a separate window.

Each chrome person starts a separate browser instance with its own cache, bookmarks, history and extensions.

New PowerApps Licensing: kills the Canvas App P1

When you consider the scenarios where you had to expand on the Office base licence and opt for a P1 PowerApp plan… well in October this won’t be possible!

You’ll have to go for either the “per app” plan (which has a minimun user count of 30) or a “per user” plan which is pretty close to what the P2 plan was.

In no case does the price tag gets lower to what you get currently with P1

As for choosing between per app or per user… the threshold is 8 users where the per user total per months hits the $320 USD mark (vs. $300 per app licence).

Then again… it all depends on the number of apps you have deployed 😉

AI Builder – Object Detection (My Pet Project)

 

You may have heard the buzz around the AI Builder functionnalities that are now available in preview on the Power Platform..

See how to build a model using the Object Detection tool in this video, using our new kittens 😉

If you don’t see the AI Builder functions ? Get the details here: https://powerdiver.blogspot.com/2019/06/ai-builder-not-available-heres-how-to.html

I hope you enjoy it!

Don’t forget to subscribe to my channel please!

identify colleagues from photos using Canvas apps and cognitive services

Some time ago, I thought about creating a Canvas app with the Microsoft Power Apps platform, something which can be useful in the company and also use Microsoft Azure cognitive services.

Finally, I decided to use Face API of cognitive services to make some fun with face recognition to detect my colleague’s faces and information from the photos. most of the companies have yearly events and lots of photos from employees. search within thousands of photos to find only a specific person wouldn’t be easy. with the use of Microsoft cognitive services together with the help of Office 365 API it would be easy.

First of all, we need to have at least one photo of each colleague and it’s available already in the Office 365 profile picture. So we can use Office 365 API user search to find all the employee list from active directory and recognize the face from the profile picture and register the user as a person in cognitive service. also, each office 365 user profile information can be stored as a person meta data in cognitive service and detected face from the profile photo with a unique face Id will be assigned to that person object.

from now on we can just take a photo of a colleague using a smartphone camera or just an existing image to recognize the persons in the photo.

   

search and find people in photo

I dig a little bit deeper into the implementation of the solution. To simplify the maintenance of the entire workflow and process, I’ve created most of the business logic and services in a REST API using Function Apps, and then made a Custom connector from it in Power App in order to call these endpoints directly from my canvas app or also from a custom Flow. Therefore, I should not update the Canvas app at all after a few minor changes in API.

by capturing photo with camera, the photo will be send to the API in order to be analysed and find the person face. it detect also all the faces in a photo and find the persons base on the faces.

Integration with SharePoint
It is also possible to find similar faces in a bunch of event’s photos. the only thing that should be done is analyzing each photo content during storing the photo and identifying all faces. If the photo gallery already exists, then we need to execute the process one time for all pictures.

imagine that there is a photo gallery in SharePoint and we want to find all photos of person A. after identifying the faces in the photo, we need to store all the face Ids in a Large list of all faces in the cognitive resource database. Also, we can store the photo metadata, like SharePoint Item Id or Picture URL, as user data per each face. for instance the location of the face in the photo, so if there is more than one face in a photo we can find the location of the person later on. This process can be done also by using Microsoft flow.

After we identified and stored all the faces from Photo Gallery into a Large Face List, we can start taking a photo or just using the person office 365 profile picture to find all other similar faces in the face list. The result of the process can be a list of face Ids with user metadata (the picture URLs). so we can show all the photos using the URLs.

of course, it makes sense to integrate this feature as a plugin or a work flow in SharePoint. Imagine that during uploading photos to the SharePoint, this service can find and recognize the faces in the picture and add some tags (person’s name) to the item.

Create a 90 day or 1 year tenant in the New Customer Digital Experiences platform

In case you didn’t know, Microsoft Demos (demos.microsoft.com) has been migrated to the new Customer Digital Experience platform (cdx.transform.microsoft.com).

In this new platform, new tenant types are introduced which let your create cusom type tenant for a period of 90 days to 1 year.

To create a new tenant, head on ever to https://cdx.transform.microsoft.com then select My Environments.

Select Create Tenant 

Specify the type of tenant, period, tenant location, and content packs and you’re good to go.

 

Creating a Quiz in Forms Pro

Today we had a “bring your kids to work” day at Barhead Solutions in Melbourne, Australia, with six kids between the ages of 8 – 13 in the office.  I was brave and stupid enough to insist they take a break from the games and movies to create a quiz together, using Forms Pro.  I’ll be honest – there were varying degrees of enthusiasm in the room – I was competing with a Lego car set, a seriously huge pack of textas, origami paper, Uno, Monopoly cards, and tummies full of pizza.  But I was determined, enthusiastic, and in charge, and I put Forms Pro up on the big screen and forged on. with my own unique brand of enthusiasm…

Once the kids came up with the concept of a “How much of a kid are you?” quiz, I had more than half of them on side, and it wasn’t long til I had the whole group.  At first their questions were all about opinions – who was your favourite character in a movie – which led to an discussion of the difference between a survey (opinions, feedback) and a quiz (right and wrong answers with scores).  There is nothing quite as good at testing your understanding and ability to explain clearly as having to get a bunch of kids on track.

And so we worked together, constructing questions in their various areas of expertise and interest – cartoons, super heroes, Minecraft, board games, YouTubers, Disney Princesses.  I taught them (by stealth) how Forms Pro works, showing off the AI that appeared in various questions as we created them, much to their increasing delight.  Then we circulated the quiz to everyone at Barhead.  They watched their parents get things right and wrong. They watched the results come in, and the charts and reports being created and changing. The pizza was good, but this might actually have been the highlight of the day –  when we got 47 responses, most of which proved the adults don’t know as much as the kids!  The kids also loved the built in themes, and were very proud of how their quiz looked when we sent it out.

I’ve done a lot of demos with Forms Pro surveys, but this was my first real experience of putting the quiz functionality through its paces, and I learned a lot.  There is functionality there that I didn’t know existed, including the ability to grade and post results.  All the question types that appear in surveys are available to quizzes, but they don’t work quite the same way – for instance, the NPS question (“How much did you like our survey?”) shows as a dial, rather than a sentiment analysis, and doesn’t auto-score for the points available.  I’d also love to see the ability to allocate pro-rata points for multi-response answers (e.g. where someone picks 2/3 correct answers but misses the third one) – as much as the kids delight in seeing adults get things “wrong”!.

Overall, it was a fun and informative experience, which will lead me to explore more of the quiz functionality in Forms Pro.  I suspect when we have these kids back again on a day in the next school holidays, I will be able to hand over the laptop and let them create the next survey themselves.  It’s really that easy!

You can test yourself on our “How much of a kid are you?” survey here – but be warned – these kids are tough quiz masters – and no googling allowed!  https://forms.office.com/Pages/ResponsePage.aspx?id=DEOYUBLCG0GHJcJRCqvR1VOqayAv2uZIlXHN_DK7jh9URUlPSkdCSktZTEM1SjZBOUc0MlBWTjVNRS4u

D365UG Bristol

Man, oh MAN! I am just on the train back from Bristol after attending their first 365 User Group. and it was AWESOME!

First up, big props to the organisers @lubo @dbarber @xrmjoel @robpeledie @leembaker for doing such an amazing job. The venue was great, the food was too (including vegan options :-)) and the swag bags were epic.

But more importantly, the speakers were amazing.

First up, Mark Smith did a fantastic presentation to explain the (seemingly unexplainable) Common Data Model, which is something that sits on the CDS and exists to make sense of your data so that it is usable and, more importantly, means you can build apps faster. Considering he knew nothing about the CDM 5 days ago, this was a great presentation which goes to show how quickly you can assimilate information when the data is available in a usable format (see what I did there *winks*)

Second up was @scott-durowdevelop1-net showing us how much the Power Platform has changed in such a short space of time, and why that’s such a good thing, enabling access to a much wider audience and giving rise to things like the Citizen Developers who can effect such great change in an organisation, and how we all need to embrace change and be adaptable.

And finally, @themarkchristie with an entertaining presentation on how he bought headphones at the Microsoft store and @lubo busted them 5 minutes later – but not to worry, Virtual agent was able to help him raise a support ticket through Forms Pro, which then could be assigned to someone in Field Service, leading to the headphones being fixed (whilst being worn by Mark Smith).

I learned a lot about how to better use the tech we have openly available to us in a more inventive way, and how to work with the community to find answers to stuff that you are struggling with.

I love these community events and I hope to attend each and every one that I can.

Again, big thanks and well done to the organisers.

Love to all

Alison

(Me when I won a Flic button from @themarkchristie)

Retrieve option-set values and labels without use of metadata request in Plugin and JavaScript

 

Metadata is the place of database where we can retrieve information about structure of database such as attribute properties, length, maxsize etc. In most of the requirement we need to retrieve option set values in javascript as well as plugin.

 

  1. If we use Xrm library to retrieve option-set value, we can get only selected option set value and label.

var OptionValue = Xrm.Page.getAttribute(“logicalnameofattribute”).getValue();

var OptionLabel = Xrm.Page.getAttribute(“logicalnameofattribute”).getText();

 

 

  1. In case of plugin as well we can access only label and value of selected option.

int OptionValue = EntityObject.Attributes.Contains(“logicalnameofattribute”) ? EntityObject.GetAttributeValue<OptionSetValue>(” logicalnameofattribute”).Value : 0;

 

string OptionLabel = EntityObject.FormattedValues.ContainsKey(“logicalnameofattribute”) ? EntityObject.FormattedValues[“logicalnameofattribute”] : null;

 

“Any system is only as good as the metadata that it ingests.”
― Chris Bulock

 

I believe that MS Dynamics CRM is as easier as to retrieve metadata in Javascript and c# as well. Here I will show you how we can retrieve metadata of optionset without use of metadata request.

I will explorer here more with technical example how we can retrieve metadata of optionset using stringmap table.

 

  1. Plugin:

Here I’m using fetch expression to retrieve stringmap table of account entity.

string EntityLogicalName = “account”;

string FieldLogicalName = “customertypecode”;

string FetchXml = @”<fetch version=’1.0′ output-format=’xml-platform’ mapping=’logical’ distinct=’false’>

<entity name=’stringmap’ >

<attribute name=’attributevalue’ />

<attribute name=’value’ />

<filter type=’and’ >

<condition attribute=’objecttypecodename’ operator=’eq’ value = ‘” + EntityLogicalName + @”‘ />

<condition attribute=’attributename’ operator=’eq’ value = ‘” + FieldLogicalName + @”‘ />

</filter>

</entity>

</fetch>”;

FetchExpression FetchXmlQuery = new FetchExpression(FetchXml);

EntityCollection FetchXmlResult = service.RetrieveMultiple(FetchXmlQuery);

if (FetchXmlResult.Entities.Count > 0)

{

foreach (Entity Stringmap in FetchXmlResult.Entities)

{

string OptionValue = Stringmap.Attributes.Contains(“value”) ? (string)Stringmap.Attributes[“value”] : string.Empty;

Int32 OptionLabel = Stringmap.Attributes.Contains(“attributevalue”) ? (Int32)Stringmap.Attributes[“attributevalue”] : 0;

}

}

 

 

 

  1. JavaScript:

Using following API request we can get stringmap table in javascript

 

var req = new XMLHttpRequest();

req.open(“GET”, Xrm.Page.context.getClientUrl() + “/api/data/v9.1/stringmaps?$select=*&$filter=attributename eq ‘customertypecode’ and objecttypecode eq ‘account'”, false);

req.setRequestHeader(“OData-MaxVersion”, “4.0”);

req.setRequestHeader(“OData-Version”, “4.0”);

req.setRequestHeader(“Accept”, “application/json”);

req.setRequestHeader(“Content-Type”, “application/json; charset=utf-8”);

req.setRequestHeader(“Prefer”, “odata.include-annotations=\”*\””);

req.onreadystatechange = function() {

if (this.readyState === 4) {

req.onreadystatechange = null;

if (this.status === 200) {

var results = JSON.parse(this.response);

for (var i = 0; i < results.value.length; i++) {

var OptionLabel = results.value[i][“value”]; // Label

var OptionValue = results.value[i][“attributevalue”]; // Value

}

} else {

Xrm.Utility.alertDialog(this.statusText);

}

}

};

req.send();

 

  1. SSRS Report (as optionset parameter)

One more use of stringmap entity is that we can use the same fetchxml to create dataset and pass parameter of optionset in place of hard coded value.

<fetch version=’1.0′ output-format=’xml-platform’ mapping=’logical’ distinct=’false’>

<entity name=’stringmap’ >

<attribute name=’attributevalue’ />

<attribute name=’value’ />

<filter type=’and’ >

<condition attribute=’objecttypecodename’ operator=’eq’ value=‘account‘ />

<condition attribute=’attributename’ operator=’eq’ value=’customertypecode‘ />//Field logical Name

</filter>

</entity>

</fetch>

 

 

Hope this will help you 😊