Testing security roles with only a single user ?

Before I say anything, Dineshkumar Sivakumar has written a superior quality blog on the flow, please do read his blog for details regarding the flow structure, I have not deep dived into the flow as he has taken the effort to explain this flow exhaustively -https://thetechiedood.wordpress.com/2021/05/05/assign-remove-security-roles-to-users-via-power-automate/

Linkedin – https://www.linkedin.com/embeds/publishingEmbed.html?articleId=8650792220427939372

So recently I was testing a few security roles out, I am sure we all have been here at some point or the the other where you have either a previlae set for read and want to make sure you can’t write or you have a rule set to hide a button based on a security role etc.. the list is never ending.

Well, in my case I only had one user and was clueless how to proceed, the second I would remove my System administrator role I would not be able to re-assign my role back, the only way out was to bug someone to promote me to admin again.

Below are the list of things I tried and since I had the basic outline of the flow ( once again thank you @Dineshkumar ) a few updates to it would make it a beautiful looking app with a lot of functionality.

I used the new PowerApps connector that allows you to take variables as parameters from the PowerApps to the flow –

Let’s begin with what to not do to start – Initially I started with adding dataverse as a data source in the form of a connection, this looked very neat and worked flawlessly till I changed my security role to a non system admin – power apps with dataverse as a connection takes Your security role into consideration, so the second you remove your security role you loose access to the tables in your app – #DONT_BE_A_KARAN

But in case you want to have a drop down approach you can use the below formula ( provided you are not changing your own role )


The best part of using this is it takes the GUID directly from the table so no more nested loops to get the GUID from the name or email address.

My next approach was to use a text input field and take the email address and security role name from the user as input; the formula on the ADD Security role button would look something like –


The above formula creates a global variable ( called result ) and becomes an object of the result,

PowerAppV2->GetarowbyID2,GetarowbyID’.Run = Flow name

TextInput3,TextInput4,”1″ = Parameters; the first one is the email address and the second one is the security role name. The Value “1” is a flag value to direct the flow to either add or remove the security role. In my case 1 is used on the add button and 0 for the remove button.

If(result.success=”No”,Notify(“Failed”),Notify(“Success”)); = A condition to check if the returned value from the flow is equal to “No” and notify accordingly. { the structure of IF is if(condition,success action, failure action );}

Now let us begin with the flow –

I encapsulated the list conditions to find the user and role along with the other actions in a scope, the next action sets the output variable to No if the scope fails and hence decides the notification in the app

Notice the condition in the above picture, the condition checks the value of the third parameter to decide if you are adding or removing a security role.

For the next actions I followed Dineshkumar’s blog; posting it here once again https://thetechiedood.wordpress.com/2021/05/05/assign-remove-security-roles-to-users-via-power-automate/

I used the relate action by passing the GUID of the role in a static formatted URL which is a little different from the blog but the idea remains the same

And the working would look like –

No alt text provided for this image

You can now add this on teams too by following – https://powerapps.microsoft.com/en-us/blog/add-your-canvas-apps-to-microsoft-teams/

I hope this helps 🙂

Show Hidden a preview feature in the maker portal

Previews are the best !! I know people are going to differ here but let me justify myself with this feature I found on the Preview version of the maker portal.

make.powerapps.com has a secrets brother called make.preview.powerapps.com where Microsoft tends to release a few cool features once in a while.

So the feature in todays post is – Show hidden – when you open a form in the preview version you would find this at the bottom on the page like —

The use of this is to visually be able to see the data that is hidden using the hide option. however this does not mean you would be able to see labels hidden by the option “hide labels”. As illustrated below – the section is hidden but it is visible because of this feature however the label of the section is also hidden but this does not show up.

Comparing this to the todays maker portal and the yesterdays legacy portal we can see Microsoft has done an amazing job out here !!!

If you are like me who tends forget to check the visibility criteria on tabs/sections then this feature is going to save you a good amount of time ( #Dont_be_a_karan)

I hope this helps 🙂

If you are wondering why you cannot find an account record with the help of the website this might help you out.

The reason I am here writing this post is because I spent a lot of time on this and I really hope this saves you time. #Dont_Be_A_Karan

If it wasn’t for the help I got from a senior collogue I would probably still be lost with understanding what could be going wrong.

Problem : Importing records via Excel or any tool on XRM toolbox such as Dataimport++ takes the website URL as plain text however while creating the record from the system https:// gets appended to the text.

The system in a pretense to make things seem alright tends to add https:// at the beginning of the record on the UI level of the form; to my dismay this created more chaotic confusion than good.

Because of this problem you would probably face issues finding the correct record in the system; the system tends to consider http://www.google.com and https://www.google.com as two different websites.

Findings –

The website URL field on the Account form is defined as below –

I have 3 records to illustrate this – one imported via Excel, one imported via Dataimport++ and one created from the system. Let us compare the OData of these 3 records.

Record 1 – Made Via excel

Notice that there is no https:// appended to this at the start

Record 2 – Made from CRM directly

Notice there is an https appended to the starting of the field value.

Record 3 – Made from dataimport++

Yet again there is no https:/ appended to this.

Solution – Any update to the record will fix this field to http://…. so either do this manually or lets automate it 🙂 !! and of course we are going to automate it 🙂

In my case I wanted to keep the records without the https added to the URL the below flow would find the records and update the field accordingly ( make sure to add the filter condition in the list rows action )

on demand trigger – list records account filter condition – (startswith(websiteurl, ‘https’)) and update account by using the function –replace(items(‘Apply_to_each’)?[‘websiteurl’],’https://’,”) in the website field

and this should fix the website field to –

I hope this helps 🙂

A few shortcuts that help me save time

The reason behind writing this article is – I use a few short cuts to save time I wanted to share this with the community so that we all save a few extra seconds and make the best of our time. In case you have more short cuts please do add them in the comments section !!

Non-Dynamics 365 related

* My favorite short cut is Ctrl + Windows + D this creates a new virtual desktop, works best before going for a client demo.

* Windows + V, so I see a few people swapping between tabs to copy and paste, here’s a trick – copy around 7-8 lines and once and then paste at the destination using windows + V

* This one is not very helpful but getting to teams has a shortcut – aka.ms\\/mstfw

Dynamics Related.

* aka.ms/ppac – the short cut to reach https://admin.powerplatform.microsoft.com/ – this is a life saver for people like me who are terrible with their spellings

* Scenario based short cut – have you ever been in a situation where the naming of the environment and the URL of the environment are not co-related ? for example the URL of the UAT environment is companyname123.dynamics.crm.com but the name of the environment is UAT…

When you head over to flow.microsoft.com or make.powerapps.com people ( like me !! ) generally tend to forget which environment they were working on.. we either remember the name or the URL..

1) To verify the name of the instance ( environment ) and the URL from the dynamics environment click on your profile like below – you would see the name out there

2) To verify the same from make.powerapps.com use ctrl+alt+A

3) To verify the same from flow.microsoft.com use the same as above ctrl+alt+A and on the new tab that opens use ctrl + F and search for Instance/URL

Add alt text

In case you know more short cuts like these please do mention them in the comments 🙂

I hope this helps 🙂

Poral Bypassing Duplicate Detection Rule ? Here’s a possible solution

Before I start this post, there are probably better ways to do this, I found this way to overcome what I was trying, but please put your suggestions down in the comments of this post.

It all started over a Kaizala group (our community details are – https://join.kaiza.la/p/dynamics365champ ) where a community member was trying to import data using a XRM tool box tool called DataImport++, the records created from here seemed to bypass the duplicate detection rules, now since it was datasource getting imported, we had an alternate option to run a duplicate detection job and keep our CRM data clean.

But what intrigued me was why were the duplicate detection rules not stopping this data… A few days later, I was creating a record on a Portal and yet again, contacts created from the portal were able to bypass the duplicate detection rule.

I googled this and found really good articles like – https://www.linkedin.com/embeds/publishingEmbed.html?articleId=9188128198143633994

So a suggestion of alternate key was provided in many articles like the above, which was useful, but this way a portal user would NOT BE ALLOWED TO CREATE A CONTACT IF A CONTACT EXISTED IN THE SYSTEM.

And that got me thinking about different business scenarios where the same contact might actually need to be entered into the system again. Let me give one below-

Let us assume we have a business where two partners are calling the same customer, now let us assume the two users cannot see each others contacts, however this should not restrict a user from creating a contact or linking their association to it in a portal.

It gets interesting from here –

For the above use case and possibly many more like these the below solution might be helpful.

I created a custom entity called Partner_ID and added a lookup field to this entity on the contact from. Now when this form was on the portal a user would need to give a partner ID to create a contact.

Add alt text

The third part of the visio diagram will be explained in detail.

Flow Trigger – When a contact is created. Dataverse.

The next step would be to use the list rows and filter the rows based on “ emailaddress1 eq ‘@{triggerOutputs()?[‘body/emailaddress1′]}’

Add alt text

Well the above two steps now tells us if we have any duplicate record based on the email address, but here is where flows acts very strange, it finds two records with the same email address, one is the original and the next is the one that was just created.. to fix this I found a way to trick the system.

I used a condition to check if the record GUID in the list is equal to the GUID of the record created.

Notice the different sources for the dynamic values below –

Add alt text

Add alt text

If they are equal then the system will do nothing.

If they are not equal then I want to link the contact with the partner_ID and delete the new record created ( to avoid duplicate data in the system)

Add alt text

To demo this I have created two contacts from the portal with the same email address – test2@test.com

In CRM we find only a single record created with the related data to two different partner ID’s

As you can see the Custom_PartnerID_lookup is a lookup field to Partner ID table, however there is also a N:N Relationship that is used to relate the future records ( if any )

Add alt text

The N:N relationship was utilized below –

Add alt text

I hope this helps 🙂

A few lookup feature here and a few over there !

With each update that the maker portal ( make.powerapps.com) gets I start to prefer the update a little more. However recently I was trying to enable a look up field in the maker portal in such a way that the look up would filter records, in the old UI this was easily done by-

This feature is vital when you want to have a nested lookup, however as on 4th May 2021 it looks like the maker portal does not have this feature

But as the title of the post says “a little here and little there” the look up capability on the maker portal has something really nice to offer !! Main Form Dialog

This feature is a blessing in disguise; remember clicking on a lookup value and then going to the record value, well this small change can save so many tiny minutes !!

This is what the feature does when it is turned on for a lookup – Clicking on the “Primary contact” ( the lookup field where we enabled this setting ) we get a popup

more about this can be found at – https://www.inogic.com/blog/2021/02/open-lookup-field-form-in-the-same-context-of-the-main-form-within-dynamics-365-crm-power-apps/

Conclusion – we are yet to see the maker portal go in full bloom but good things take time 🙂

I hope this helps 🙂

Use a lookup field that can find a record using multiple fields

Can a look up field for contact find a contact with using lets say a contacts phone number or a contacts email-ID or as a matter of fact to spice things up let us create a custom field called contact ID and add data into this.

The requirement is to find a contact using a look up with data other than the contact name. I thought this was not possible till I did some searching.

I am sure a lot of people reading this might know how this is done but the reason of writing this article is to save someone’s time who is searching how to do this and can’t find it on google. So don’t be a Karan and check out the solution below –

Problem –

While using a look up in a case form on customer field I cannot find a customer with data that is populated in a custom field.

Pre- Requisites for the demo –

Create a custom field called pen name in the contact entity add it to the contact form.

Add alt textNo alt text provided for this image


The solution lies in the the views of the system, my first place to check was the lookup view but that is not the place to look at.

Open the quick find view

No alt text provided for this image

This view has something magical called Add find columns

Add alt textNo alt text provided for this image

Well, although this looks nice I am in love with the new interface ( Maker Portal make.powerapps.com) below is the screen shot of the settings let me know which one you prefer 🙂

No alt text provided for this image

Now that we have this column added into the view, searching for this field in the look up for the entity will get you the desired record.

Demo – Let us save a contact record in the system with the name – kkice for karan

No alt text provided for this image

Now let us go to the Accounts and use the look up “Primary contact” let us search for kkice

No alt text provided for this image

I hope this helps 🙂

Linkedin Article Link – https://www.linkedin.com/pulse/use-lookup-field-can-find-record-using-multiple-fields-karan-khosla/?published=t

Store your Knowledge Articles in Sharepoint!!

No alt text provided for this image

If you are like me and are always finding ways to save money when it comes to storage then welcome aboard!

I recently stumbled on this new site map option called “Search Providers”

No alt text provided for this image

This Preview Feature is definitely a game changer when it comes to storage.

Having KB articles is good for day to day activities where your team can refer to the articles and close cases really quickly but then over the years you realize these articles occupy way too much space and the database keeps increasing.. The solution to this is here !!

Before we begin let us show you a quick cost comparison between SharePoint storage and D365 storage; A popular website mentions the cost difference is around 1:50

No alt text provided for this image

Additionally a lot of licenses give SharePoint storage, and yes this most often this gets wasted, but not any more 🙂

you can now store your kb articles on SharePoint !! so that means there is no more wastage of precious dynamics storage 🙂

Configuration Steps –

Step 1 ) Create a search provider record –

No alt text provided for this image

Select Search type = SharePoint

Step 2 ) Create a SharePoint website

No alt text provided for this image

Step 3 ) Add documents to this website

No alt text provided for this image

Step 4) Copy the URL ( only the URL of the website and nothing else)

No alt text provided for this image

Step5 ) use this URL in the Search Provider record

No alt text provided for this image

Step 6) Search for a KB article and you will see the document from SharePoint !!

No alt text provided for this image

I hope this helps :

Create custom Links for Surveys with Variable data to avoid creating new surveys

Status is onlineKaran KhoslaApplication Development Analyst at Accenture19 articles

Customer voice just got a new feature!! this product just keeps getting better and better every day !!

To illustrate the use of this feature, I will be using problems and then talk about this feature saves us time and effort

Problem 1) Let us assume we have a portal/website where users do not need to be authenticated, and the response you want from them is Anonymous however you want them to click on a button based on their Job so that they see the variable for Job populated in the Survey.

An example question can be ” do you feel good working as an {{Job}}” and based on the button clicked the variable would get populated.

Not the correct Solution – Create a different survey for each job and create a link for each of the buttons.

why the above-proposed solution is flawed – The responses from different designations in different surveys would definitely give a good understanding of how happy each designation ( as a group ) is but what if the end goal was to find out how happy all the employees are in an organization irrespective of their designation? ( like a happy index ).

A new approach: Create a unique link with variable data populated in it. However, the results will still be stored in a single survey and irrespective of the designation ( variable )

Problem 2) Let’s say you want to send out Emails to users who attended a conference and the Survey has a variable called {{Job}}, depending on the Job you want to share the link via email.

Solution Now all you need to do is use the links created with the variable data populated into it.

How to use this new Feature !!!

So, the feature is not new as such, there was a way to use variable data in customer voice surveys right from day one, MVP Megan Waker mentions this in her article – https://meganvwalker.com/passing-variables-through-the-forms-pro-survey-url/

The trick was to append &ctx={"<Var1>":"<Value1> ","<Var2>":"<Value2>"}
to the end of the URL of the Survey link

No alt text provided for this image

But Customer voice makes use of tiny URL’s and sending out a large URL with the variable populated at the end might look strange to the end-user ( at least while sending these URLs out via email )

To make this feature easily accessible Microsoft has now allowed users to create tiny URLs with variables straight from the application !!

Head over to Customer voice and click on send. Let us select “Link” to send the survey out via a link

No alt text provided for this image

Notice it says create a link out here!

By clicking on Create a link you get a choice to select which variables you populate and create the link

No alt text provided for this image

If you have a list you can also make use of the CSV option for bulk data

No alt text provided for this image

Once the link is made you can either make it into a QR code or copy the link and use it in an email or add it to a button in a portal

No alt text provided for this image
No alt text provided for this image

I hope this helps 🙂

Like reading about new features and knowing more about Dynamics 365 ? then I would request you to follow the Page D365 Champions, this page is very informative and fun !!

Getting started with the Omnichannel Trial

  • Published on March 19, 2021

A quick post about our recent encounter with Omnichannel which I found really strange and wanted to share the workaround we found after spending a considerable amount of time on a way to get the trial up and running.

So, the omnichannel documentation says you need to have 2 things for an Omnichannel trial, this is, of course, going to be done after setting up a trial instance from trials.dynamics.com

Omnichannel document – https://docs.microsoft.com/en-us/dynamics365/customer-service/try-channels


  • 1) Paid or trial subscription of Dynamics 365 Customer Engagement
  • 2) Dynamics 365 Customer Service Digital Messaging add-on Trial.

But after making a subscription-based trial you would not see the Omnichannel app present in the admin level of the instance ( you would see this in the environment level but the service is not active although the app is installed in the environment )

No alt text provided for this image

Now, we were ideally waiting for omnichannel to show up in the tenant-level applications but this did not happen.

Okay, wait, where did we mess up ?? Didn’t we do everything by the book ?? how did this happen?

After looking at this with a smarter pair of eyes ( Thanks Manali !! https://www.linkedin.com/in/manali-pate-80093675/ ) we found that creating a new trial of type – Customer Service would automagically get the tenant level application for Omnichannel, so now reaching the configuration page was possible

No alt text provided for this image

But there is something really strange here, although the new environment got us the tenant level application for omnichannel, the Omnichannel service will not get configured on the email trial environment, it would still need to be set up on the Subscription-based trial so it looks like the new trial is just required to cross this hurdle but isn’t required after that.

A special thanks to @Manali for helping me with this !!

I hope this helps 🙂

Create your website with WordPress.com
Get started