Reader small image

You're reading from  Creating Actionable Insights Using CRM Analytics

Product typeBook
Published inDec 2021
Reading LevelBeginner
PublisherPackt
ISBN-139781801074391
Edition1st Edition
Languages
Tools
Right arrow
Author (1)
Mark Tossell
Mark Tossell
author image
Mark Tossell

Mark Tossell is passionate about solving problems and improving processes using data. Tableau CRM (Einstein Analytics) and Tableau, powered by AI, are the tools of his trade. He is a proud wearer of the Salesforce Gold Hoodie and recipient of the inaugural APAC Awesome Admin award. He is also a Trailhead learning addict, having earned over 420 badges. In addition, he is honored to be a Tableau CRM Ambassador and a Salesforce Partner Solution Engineer. Mark lives in Sydney, Australia, with his wife, Christina, and son, Adam.
Read more about Mark Tossell

Right arrow

Chapter 10: To Code or Not to Code?

One of the greatest challenges for CRM Analytics (CRMA) admins and developers is knowing when to code and when not to code. This causes a considerable amount of confusion. The purpose of this chapter is to guide you through how to determine when code is required by covering numerous practical examples.

Where code is required, examples of the sources will be given. However, please note that this book is not intended to be a detailed manual for CRM Analytics developers. Also, the code snippets given are, of necessity, often only small portions of the complete source code.

In this chapter, we will cover the following topics:

  • When do you need code?
  • You might not need to code if…
  • Occasions of ambiguity

Technical requirements

You will need the following to successfully execute the instructions in this chapter:

  • The latest version of the Google Chrome browser (Chrome is the preferred browser when working with CRMA)
  • A working email address

Ensure that you're logged into your CRMA development organization.

Let's begin by understanding where you may need to use code in your CRMA application.  

When do you need code?

The GUI of CRMA has come a very long way indeed since Wave was launched by Salesforce in 2014. Early users of the platform were forced to build everything in JSON, SAQL, and XMD as there was, essentially, no declarative option. Things are different now, with every new release of CRMA providing more point-and-click functionality.

However, there are applications of CRMA that do require code as you move into more advanced data transformation and dashboard building.

Here are six common applications in CRMA where you are required to deploy code:

  • Security predicates
  • Bindings in the JSON
  • SAQL expressions
  • Bulk actions (using Visualforce and the CRMA REST API)
  • timeseries (modified)
  • XMD – advanced formatting options

Let's begin with security predicates.

Security predicates

As you saw in Chapter 7, Security in CRM Analytics, a predicate is a filter condition that defines row-level security for a dataset. Security...

You might not need to code if...

As Salesforce continues to develop CRMA, more advanced querying and customizations can be performed in the GUI, requiring less work to be performed using code. This aligns with the Salesforce mantra of clicks and not code.

The following are use cases where code was once required, but now may not be:

  • Data flow, data prep, and recipes:

Code is not required for data flows (JSON) or recipes except for complex use cases.

For a detailed reference about dashboard JSON, see this developer guide:

https://developer.salesforce.com/docs/atlas.en-us.bi_dev_guide_json.meta/bi_dev_guide_json/bi_dbjson_intro.htm.

  • Dynamic reference lines (simple):

This can now be performed in the dashboard editor.

  • Simple application bindings:

Simple bindings can be constructed using Advanced Editor in the dashboard editor.

  • Adding datasets to a lens:

Additional datasets can now be added to a lens via the GUI using...

Occasions of ambiguity

The more familiar you become with building lenses and dashboards using the CRMA GUI, the more you will understand where code is required. A best practice is to use the GUI whenever possible, and only resort to code where it cannot be avoided. Also, be sure to stay up to date with the new CRMA releases since the GUI becomes more capable with every release.

I want to share one final example of where I used code – in this case, customizing the JSON data flow to reset and refresh dates every time the data flow was run:

"relativeDates2": {
    "action": "computeExpression",
    "parameters": {
      "source": "substituteNewDate",
      "mergeWithSource": true,
      "computedFields": [
        {
  ...

Summary

The purpose of this chapter was to help you understand when code is required in a CRMA build and when it is not required.

What have you learned? First, you should now understand the various use cases where code is required to deliver your requirements. Next, functionality that once required code and is now available in the GUI is clear to you. Lastly, you have been shown an approach where the requirement for code is not clear.

In the next chapter, you will dive into the exciting world of dashboard design best practices.

Questions

Fill in the blanks – you learned about six applications where you are required to deploy code:

  • Security __________________
  • Bindings in the ________
  • SAQL __________________
  • Bulk actions (using __________________and the CRMA REST API)
  • __________________ (modified)
  • XMD – advanced __________________options
lock icon
The rest of the chapter is locked
You have been reading a chapter from
Creating Actionable Insights Using CRM Analytics
Published in: Dec 2021Publisher: PacktISBN-13: 9781801074391
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
undefined
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $15.99/month. Cancel anytime

Author (1)

author image
Mark Tossell

Mark Tossell is passionate about solving problems and improving processes using data. Tableau CRM (Einstein Analytics) and Tableau, powered by AI, are the tools of his trade. He is a proud wearer of the Salesforce Gold Hoodie and recipient of the inaugural APAC Awesome Admin award. He is also a Trailhead learning addict, having earned over 420 badges. In addition, he is honored to be a Tableau CRM Ambassador and a Salesforce Partner Solution Engineer. Mark lives in Sydney, Australia, with his wife, Christina, and son, Adam.
Read more about Mark Tossell