Skip to main content
Free Agentforce workshops and AI Certifications: Learn more. Terms and conditions apply.

Automate Secure Logins Using an RPA Process

Learning Objectives

After completing this unit, you’ll be able to:

  • Use a user account type activity parameter.
  • Use a User Account Decrypter.

In this unit, you learn how to automate user actions to enter secure login information to a website.

Pass in Credentials Securely with a User Account Activity Parameter

Sometimes the process you need to automate involves logging in to an account, whether on a website or a desktop application. This is easy enough with the skills you’ve already learned. Simply add an alphanumeric activity parameter for the login and another for a password, and you’re good to go.

Does this solution make you uneasy? It should. It’s incredibly insecure. Alphanumeric activity parameters aren’t encrypted, and they’re displayed on screen in clear text when used in testing or in a User Task in production. For this reason, there’s another type of activity parameter called a “user account.” The user account activity parameter has two values: username and password. The text entered in the password field is masked and is stored encrypted.

Access Encrypted Fields with the User Account Decrypter

To use a user account activity parameter, you need to use a new action step called the User Account Decrypter. The User Account Decrypter accepts a user account activity parameter and makes the fields accessible to the workflow. Combining this with the other skills you’ve learned so far, you can log in to a website or any other secured account.

Clear the Fields

When entering data into text fields, the fields may already be populated with data. It’s a best practice to clear text fields before adding your own value.

Issues When Navigating Through Form Elements

There can be issues in populating text fields. There are several approaches to mitigate these issues. The stability of these approaches depends on the particular webpage and any future changes that might be made to the webpage source code.

One approach is to use an Image Search or Search Pattern action step to locate and click the first text field of the form. From there you can try to automate pressing the Tab key to move to the next form field. You need to test this carefully because even though it works with your particular setup, this same step might fail when executing in an RPA Bot instance on another machine.

Another approach is to click the label preceding the form text field. This involves using a separate Image Search or Search Pattern action step each time you want to move to the next form element. The advantage of this is that if the form is rearranged due to using a different screen resolution, different web browser, or even if the underlying webpage source changes, you may still be able to find and click the next form elements.

Even when you select the correct form field, erasing any existing data in that field can also be tricky. It’s common to use Mouse Actions action steps to simulate double-clicking a text field and then a Keystrokes action step to press the Delete key. But sometimes the double-clicking is not captured correctly or the focus is lost on the text field. In the worst case, you can simulate a loop that presses the Backspace or Delete keys to delete everything.

In general, navigating through forms can be a little tricky, so it’s important to pay special attention to form navigation when you test and troubleshoot your RPA processes.

Determine Whether Login Should Be Automated

There are a few caveats. Captcha and other “prove you’re a human” systems are difficult to automate. In fact, their purpose is specifically to stop bots from logging in. If the task you need to automate routinely involves a Captcha step, you may want to rethink whether this is a good task for automation. OAuth and multi-factor authentication are both possible, but more complicated. They’re beyond the scope of this module.

Walkthrough

Now that you’ve learned how to securely log in using encrypted credentials, take a look at the following video demonstration showing how to put this into practice after reviewing the solution from the previous challenge. If you wish to follow along, check out these  walkthrough instructions.

在 Salesforce 帮助中分享 Trailhead 反馈

我们很想听听您使用 Trailhead 的经验——您现在可以随时从 Salesforce 帮助网站访问新的反馈表单。

了解更多 继续分享反馈