Custom user settings can be saves into Dataverse. In previous post I described how to read the settings with Power Automate before notifying user in Teams. This post describes how to create the user interface where user and see the settings and manage them in Model Driven App.

Solution is to create custom page that is added in Sitra CRM which is Dynamics 365 Model Driven App. I added it as custom page but you could do this also in separate Canvas App if you don’t have Model Driven App in your solution. In the Model Driven App I added the page into navigation.

The page contains one label and toggle for each functionality meaning if you had two Yes/No columns in your user settings table, then create two toggles as well – one for each setting.

You need to add to the App OnStart this code for retrieving the settings row and if it is blank, create it for the user when user is first time on this page.

// Get user settings
Set(mySettings, LookUp('CRM User Settings', AsType(Owner, Users).User = LookUp(Users, 'Primary Email' =  User().Email).User));
// If blank, create a row for the user to settings table
    Set(mySettings, Patch('CRM User Settings', Defaults('CRM User Settings'), { Name: "Omat ilmoitukset" })));

Then attach the toggle controls for the mySettings variable correct setting

And update the toggle OnChange code to do the update after change. Remember to do these for each toggle control in the solution.

Patch('CRM User Settings', mySettings, { 'Tapaamisten muistiinpanot': Self.Checked } )

That’s it, now you have custom settings functionality up and running =)

Blog post series about custom user settings

  1. First you need to create Dataverse table and set permissions to security role
  2. Then you need to build a logic into Power Automate how to read the settings
  3. Finally there is need for creating user interface where settings can be managed