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.         

N52 Formula Manager Solution

The Formula Manager 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.

N52 Formula Manager 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



  SetVar('CSV', ''),


            FindRecordsFD('FindTAccounts', true),

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

Fetch XML- FindTAccounts

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

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?

xCache helps you manage environment specific configuration

North52's Decision Suite component xCache allows you to set up environment specific data to allow you to use different values for different instances. Your advanced business rules logic could be the same, however you need to use specific reference values for a particular instance.

For example, credentials for a web service used in your Formula - you will likely use different keys/URLs for your Dev, Test and Production instances. Store these in xCache and let the North52 business rules engine apply the correct ones at runtime! 

Learn more and see examples of xCache