Views:

Scenario Overview

In this scenario we were asked to demonstrate how to create a Comma Separated list within a N52 Formula.

To do this we use a SmartFlow.

In this example we will retrieve a list of Account numbers in CRM starting with the letter T.         

North52 Decision Suite Solution

The North52 Decision Suite solution works like this,

  • A formula of type 'Save - To Current Record' is created on the Account entity
  • For demonstration purposes the Source Property for this formula is 'Account Name'
  • The Target Property is set to the 'Description'
  • We create a Variable called CSVList to hold all the 'Account Numbers'
  • We then use FetchXML to find all the Accounts where the Account Number starts with T
  • For each account found, we add the Account Number and a comma to the CSVList variable
  • When all the Account Numbers have been added we use the Trim function to remove the last comma and then return the value of the CSVList 

*Note: This SmartFlow could be used as part of another SmartFlow or an If statement executing additional logic. For ease of understanding I have not included this here.

North52 Decision Suite Steps

The following set of steps outline how to create this Formula

  • Create a new formula of type 'Save - To Current Record'
  • Set the Source Entity to 'Account'
  • Set the Mode to 'Server Side'
  • Copy and paste the formula below into the formula
  • Click save and test

Formula 

SmartFlow(

  SetVar('CSV', ''),

    ForEachRecord(

            FindRecordsFD('FindTAccounts', true),

          SetVar('CSV', GetVar('CSV') + CurrentRecord('accountnumber') + ',')),  
        
    SetVar('CSV', Left(GetVar('CSV'), CountCharacters(GetVar('CSV')) -1)),   
      
     SmartFlowReturn(GetVar('CSV'))
)
     

Fetch XML- FindTAccounts

<fetch count="50" >
  <entity name="account" >
    <attribute name="accountnumber" />
    <filter>
      <condition attribute="accountnumber" operator="begins-with" value="T" />              
    </filter>
  </entity>
</fetch>

Wizard - FindRecordsFD

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

Note you will need to either type or paste in the following. 
 
 

Did you know?

North52 Decision Suite works with vanilla Common Data Service instances

The North52 Decision Suite works with Common Data Service instances which have not had any Microsoft 1st Party apps applied (Field Service, Customer Service, Sales Enterprise, etc). This means you can use our no-code advance business rules engine in your custom Model Driven and Canvas Power Apps! 

It is the same solution which has been powering Microsoft Dynamics 365 CR/CE for many years. You get a mature, robust solution with proven capabilities (over 500 functions) that allows you to build complex decision logic for use in your custom apps.

Learn more about the North52 Decision Suite or contact our team for more information