Mohan’s SFDX plugin for Analytics

5
(4)

A few months ago I got introduced to Mohan Chinnappan‘s SFDX plugin while working on exporting datasets from Tableau CRM (formerly Einstein Analytics). I thought it was a very helpful tool and I decided to type up a blog to help others with this use case. Little did I know at that point that Mohan keeps extending his plugin and improving it for all the different use cases he encounters, hence what started as one blog has extended into several blogs covering different use cases. For that reason I thought it best to write this blog covering how to install and update his SFDX plugin followed by a list of all the blogs related to this plugin. As Mohan continues to add new commands and I write a blog to cover it, I will update the list – maybe this is where you go ahead and bookmark this blog.

Before getting started it is important to note that this plugin is not an official plugin and as the Tableau CRM product changes with release some commands might not work as intended.

Prerequisites

In order to use Mohan’s plugin you do need to have the Salesforce Command Line Interface (CLI). I can recommend using Trailhead to get up to speed with Salesforce CLI by checking out this trail. However, you really just need to follow the section “Install the Command Line Interface (CLI)” in this module.

The final prerequisite is to install node.js on your computer, as the plugin is leveraging this.

Getting the plugin

Once you have the Salesforce CLI and node.js installed you can move on to installing the plugin. Now depending on your what operative system you are using there are different tools. As a Mac user you can use the program Terminal and as a Windows user you can use Command Prompt – some people use Visual Studio, but I tend to use terminal for my demonstrations.

In your command window go ahead and use the following command, which will start the installation of the plugin.

sfdx plugins:install sfdx-mohanc-plugins

If you want to check if the plugin was installed successfully or what version you have of the plugin you can always in the command window type:

sfdx plugins

Note: if you already have the Salesforce CLI you may need to update it by running the sfdx update command.

Updating the plugin

I’ve noticed that Mohan update the plugin quite frequently – not all for analytics purposes. Nonetheless I tend to make sure I run the update plugins command frequently to not miss out on new commands or enhancements to existing.

To update the plugin simply put the following in the command window.

sfdx plugins:update

Other good commands to remember

Working with Salesforce CLI and Mohan’s plugin there is a few commands that I have memorized since I use them over and over again. One I already mentioned the update plugins command, but there are a few more I like to highlight.

Login to an org

You always need to be logged in to an org in order to leverage the plugin, to do this execute the following command, it will open up a browser window where you can login to an org. Once logged in you can close down the browser and return to the command window.

sfdx force:auth:web:login

See all commands

There are some commands I remember by heart, but there are also a lot I do not remember. Hence the following command gives you a list of all the available commands. Those that are part of Mohan’s plugin will start with ‘mohanc’.

sfdx commands

Help

After you have pulled up the list of all the commands and found the command you want to use from the plugin you can always add ‘-h’ to see the options for that specific example. See an example below.

sfdx mohanc:ea:dataset:exportList - h

Note it is only Mohan’s plugin that uses the -h option.

Blogs leveraging the plugin

The following use cases leveraging the plugin has been described in a blog:

While several of the commands from the plugin has been covered there are still many that is undocumented on this blog and you may have to leverage the -h option to see the options required for that command.

How useful was this post?

Click on a star to rate useful the post is!

Written by


3 thoughts on “Mohan’s SFDX plugin for Analytics”

  • 1
    Scott MF on January 20, 2021 Reply

    Great post. Getting further along behind corporate firewall with: sfdx plugins:install sfdx-mohanc-plugins
    Still getting blocked but more detailed message to forward to our firewall team. Was just getting connection resets with: sfdx plugins: install @salesforce/analytics

  • 2
    Pranit Bhisade on February 11, 2022 Reply

    Thank You writing this..

    I am having problem installing it.. after running the “sfdx plugins:install sfdx-mohanc-plugins” command
    it starts installing but some how stops on below lines and the exits.
    What could be the possible reason.
    it dont go forward from [2/4] Fetching packages..

    Installing plugin sfdx-mohanc-plugins… | [2/4] Fetching packages…

    C:\Windows\system32>

    • 3
      Tim Dries on November 24, 2022 Reply

      Hi,

      I had the same problem.
      It got fixed after installing “Yarn”.

      Cheers
      Tim

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.