Documentation

Domo Actions (Beta)

Start building Domo Actions

A Domo Action is a kind of writeback Connector that updates only a specific item, instead of bulk updating all items. For example, a user could use a Domo Action to change the status of a specific opportunity in Salesforce.

Note: Domo Actions development is currently in beta. To be included in the beta and start building Domo Actions please contact us at Beta.admin@domo.com.

 

Requirements:

Your domain needs to have the Domo Actions and Writeback features enabled.

 

Creating a Domo Action

A Domo Action can be created in the Connector IDE at developer.domo.com. Please email Beta.admin@domo.com to have the feature enabled.

To create a Domo Action you will need to:

  1. Login to the Connector IDE
  2. Upload images and configure user authentication
  3. Configure the parameters
  4. Define how the data is processed
  5. Submit the Domo Action Connector for publishing

Login to the Connector IDE

1. Login to the Connector IDE at https://api.domo.com/builder/index.html#!/. When you login, the prompt asks for which Domo domain you want to develop against: enter your instance name, ex. domo.

2. Click Create New Connector, then click Domo Action:

 

 

Upload images

Icons allow users to quickly identify your action. The four images you need for an action are:

  • Icon with background (512 x 512 pixels, png)
  • Icon, no background (512 x 512 pixels, png)
  • Logo with background (512 x 512 pixels, png)
  • Logo banner, no background (1024 x 512 pixels, png)

Note: You can move on to other steps before completing this step, but icons are required before you submit your action for publishing.

Configure User Authentication

The Action Builder provides four different authentication methods:

  • No authentication
  • Username and password
  • API Key
  • OAuth 2.0

Here is an example of the authentication process for username and password. For a detailed description of the different methods, see the Configure Authentication section. For code examples, see Examples.

After selecting an authentication method and filling out the authentication fields, write a code block to validate the API’s credentials.

Note: The code block needs to determine and set the authentication to
either auth.authenticationSuccess() or auth.authenticationFailed(‘<<Insert your message>>’).

 

Code Example:

//This logging is here for testing! Remove before publishing your connectors
DOMO.log('metadata.account.username: ' + metadata.account.username); 
DOMO.log('metadata.account.password: ' + metadata.account.password);

var encodedData = DOMO.b64EncodeUnicode(metadata.account.username + ':' + metadata.account.password);
httprequest.addHeader('Authorization', 'Basic ' + encodedData);
var res = httprequest.get('https://developer.domo.com/samplecrm');  

if(res.indexOf('Account.Name') > 0){
    auth.authenticationSuccess();
} else {
    auth.authenticationFailed('Your username and password are incorrect');
}

Best Practices:

  • Ensure the script runs in ‘strict mode’ to avoid any unexpected behavior.
  • If you get errors saying “Expected JSON, but found…”, put your httprequest calls in a ‘try-catch’ block to handle errors gracefully.

Configure the parameters

Configure the parameters your action will use:

Define how the data is processed

Sample data processing:


httprequest.addHeader('Authorization', 'Bearer ' + metadata.account.access token); httprequest.addHeader('Content-Type', 'application/json');
let baseURL = 'https://na73.salesforce.com/services/data/v22.0/sobjects/'; 
let url = baseURL + "Opportunity/" + metadata.parameters["Opportunity ID"]
+ "?_HttpMethod=PATCH" let req = JSON.stringify({ 
      "StageName" : metadata.parameters["Stage Name"]
});
let res = httprequest.post(url, req); DOMO.log(res); 
var result = JSON.stringify({
      "status": httprequest.getStatusCode() 
});
datagrid.addColumn('Response', datagrid.DATA_TYPE_STRING); 
datagrid.addCell(result);
datagrid.endRow();

Submit the Domo Action for publishing

1. Click Submit for Publishing. Domo automatically checks your action for some required work and notifies you of any missing fields. If everything checks out, the action submission modal will appear.

 

2. In the Additional Instructions field, include any information needed to test and validate your action. If your action uses OAuth 2 for validation, please include a username and password. Our engineers will only use these for testing and validation.

 

3. Select your action visibility.

  • Select Shared with your company to keep the action for exclusive use in your company’s Domo instance.
  • Select Public to all companies to make your action available to all Domo users.

 

4. Click Continue Submission.

  • If you chose to make your action public: Congratulations! You’ve successfully submitted your action. Domo will begin the 30-day review process and will contact you with any questions. You can expect an update within 3 business days after submission.

 

5. Click the View Status or the Overview tab to see the status of your action review. You will also be sent email updates about your action’s status in the review process.

 

Note: To withdraw your action from submission, open the action. Click View Status. In the status window, click Withdraw.

Review Process

Your action code passes through several phases of review.

1. Automated Tests: The code is syntax checked, smoke tested, and verified for compliance to policies. We check that:

  • XMLHttpRequest is not used. Use httprequest.get() or httprequest.post() instead.
  • Code is not minified.
  • Credentials are not hard coded.
  • Information is not redirected to an external API.

2. Security Test: Domo engineers ensure that all security protocols are being followed, in addition to those listed above.

3. Performance Tests: Tests are run to make sure that the action speed relative to the number of records processed is acceptable: over 1,000 records per 5 minutes.

4. Code review: The code is reviewed by one of our developers to ensure that the code is readable and clean.

Click View Status in the Develop tab or select the Overview tab to see the status of your action review. You will also be sent email updates about your action’s status in the review process.