Scenario Overview

In the previous sample we saw the following requirement that we had a 3rd party integration creating Account records within Dynamics 365. This integration cannot set the ownerid field of the record but it can set a text field with the name of the owner. So we need to use this information to lookup the User ID value & set it to the owner of the Account record. 

In this advanced scenario we need to set a default if no User ID is found when we use the Owner Text to perform the lookup.

North52 Decision Suite Solution

The North52 Decision Suite solution works like this,

  • A formula is set to execute for the create event of the Account entity
  • It checks that the OwnerText field has data before it executes the main formula
  • The formula lookups & set a variable called 'LookupOwnerId'
  • The formula lookups & set a variable called 'DefaultOwnerId'
  • It checks to see if the variable 'LookupOwnerId' has data 
  • And sets the variable 'FinalOwnerId' based on this decision
  • Finally it updates the Account record Owner field with the value in the 'FinalOwnerId' variable

North52 Decision Suite Steps

The following set of steps will set this formula up for you.

  • Create a new formula of type 'Save - Perform Action'
  • Set the Source Entity to 'Account'
  • Set the Source Property to 'Owner Text'
  • Set the Event pick-list field to Create
  • Copy & paste the formula below into the formula description field
  • Click Save
  • Ready to test.



 SetVar('LookupOwnerId', FindValue('systemuser', fullname',[account.new_ownertext],'systemuserid')), 
 SetVar('DefaultOwnerId', FindValue('systemuser','fullname', 'Default UserName','systemuserid')),

   SmartFlowReturn(   UpdateRecord('account', 

Note 1 : The formula has been written so it easy to understand.

However we can make this formula more efficient by combining the second & third SetVar() function calls. This would save us an extra lookup in relation to the default User ID when the first one exists.

Formula Cleaned Up: 


 SetVar('LookupOwnerId', FindValue('systemuser', 'fullname',[account.new_ownertext],'systemuserid')), 

                      FindValue('systemuser', 'fullname', 'Default UserName','systemuserid'))),

   SmartFlowReturn(   UpdateRecord('account', 

Wizard - ClientSideDate

Please see below the wizard you can use to create the ClientSideDate() function call used in this formula. 

 Note 2: to find the value for Equals Value, you will need to go to the Source tab and find the field.   

Did you know?

North52 provides Automated Testing for Dynamics 365

TestShield® is a unique solution that helps you automatically test your End to End Dynamics 365/CRM and Power Automate processes.  It is built on the proven and robust North52 Business Process Activities rules engine and offers the ability to repetitively test and report on your key business processes.

TestShield's key features:

  • Fully integrated with Dynamics 365
  • Easy to use by BA's, Testers, and Developers
  • Advanced test data generation and management
  • Codeless advanced testing reduces test creation time
  • Test and validate across all layers with a single test

Learn more about TestShield

Comments (5)
  • Hello, what does the parameter 'Default UserName', do? I am attempting to modify this to grab a order record and place it on the task entity based on a text order number field. I am not sure what this Default UserName should be changed to to meet my requirments.
  • In the example above 'Default Username' refers to the value in the Full Name field for the record being retrieved by the FindValue function:
    FindValue('systemuser','fullname', 'Default UserName','systemuserid')
    This says find the systemuserid for a systemuser record where the value in the fullname field equals Default Username

    The signature of the FindValue function is: 
    FindValue('entitylogicalname', 'inputfieldname', 'inputfieldvalue', 'outputfieldname','defaultvalue', 'nolock', 'cacheenabled')
  • Is this referring to the name of the field or the value in the text field? So, looking for systemuser where their name is Default UserName or are you calling the default username from another find value clause? 
  • Basically, there is no default name for system users. 
  • It is referring to the value in the Full Name field. If the user you are trying to find for some reason does not have a value in the Full Name field, then you could use another field e.g. the User Name (logical name is domainname):
    FindValue('systemuser','domainname', '','systemuserid')

    If you need further help, please email our support team who will be happy to assist -