Note: If your ORG Key contains a double quote ("), make sure you use a backtick (`) before double quote (") to escape the character in your PowerShell script.
2. Save the file. Rename it to (e.g.g DecryptVault.ps1) and place it in the location where you need it. 
RPA flow setup
This section details how to set up your Zoho RPA flow to securely fetch passwords from Zoho Vault, decrypt them using the PowerShell script (DecryptVault.ps1), and securely input them into a web portal or desktop application.
Setting up this flow is a multi-step process designed to maintain security by keeping the credentials encrypted until the moment we actually use them in the workflow execution. The process involves fetching the encrypted password from Zoho Vault, decrypting it using a local powershell script and using the system clipboard for a temporary and secure input. 
The flow first uses the fetch password action to retrieve the encrypted credentials. A custom function is then used to parse and separate the encrypted username and password. For each  output (i.e., username and password),  the flow executes the powerShell script via the Open Application action, passing the encrypted data string for decryption. The script places the decrypted data directly on the clipboard. The credential is then pasted into the application using the Send hotkeys action. After these steps are repeated for both the username and password  a final PowerShell command is run to immediately clear the clipboard to ensure no sensitive data remains exposed.
Let's look at how to implement this process in detail.
Create RPA flow 
- Create the required RPA flow, or navigate to the flow where you want to retrieve passwords from Zoho Vault. Ensure the Agent machine that will execute this flow has the PowerShell decryption file (DecryptVault.ps1) ready and accessible.
 - Use a Web or Windows actions (like Open Application for invoicegenerator.exe or Open URL for myportal.com) to get to the required login screen.
 - Use the Click action to indicate the corresponding field (username or password) where you want to input the username.
 
Fetch password from Zoho Vault
Drag and drop the fetch password action(Under the Apps section) into your flow. In the configuration window, enter the exact password name you want to fetch from Zoho Vault. 
Next, we will use a set of actions that will retrieve the encrypted password from vault. 
Get encrypted username and password
1. Create a Custom function to parse the JSON output and get the encrypted credentials. Navigate to the Logic tab, and under Custom function, create a new custom function:
map parseVaultPassword(string secretData)
{
password = secretData.getJSON("password");
username = secretData.getJSON("username");
outputData = Map();
outputData.put("username",username);
outputData.put("password",password);
return outputData;
}
2. Use this function in the workflow, and make sure you map the password data as the input to it.
Here, we will pass the encrypted username and necessary parameters to the PowerShell script for decryption. 
1. Drag and drop the Open Application action, found under the Windows App category, into your flow.
2. Use the Indicate on screen option to locate your PowerShell application on the desktop machine. 
3. In the Arguments field, use the following commands. Remember to replace the file path with the actual path on your machine. 
-- powershell.exe -NoProfile -NoExit -ExecutionPolicy Bypass -File <replace_file_path> -cipherText "${parseVaultPassword_2.username}" -isShared "${fetchPassword_1.isshared}" -displayValue "NO"
where,
<replace_file_path> - Full path to the DecryptVault.ps1 file on your local machine. (e.g., C:\Users\Demo_user\Desktop\DecryptVault.ps1)
${parseVaultPassword.username} - username output from the parseVaultPassword custom function. (See the screenshot below.)
${fetchPassword_1.isshared} - isshared output parameter from the fetch password action. (see the screenshot below.)
4. Use the Send hotkeys action (from the Web or Windows category) into the flow and configure it (Ctrl + V) to send the paste it into the input field.
5. Add any subsequent actions required for the login process, such as a Click action on the "password " or "Next" button.
We'll need to repeat all of these steps to enter the password into the required field.  
1. Drag and drop the Open Application action, found under the Windows App category, into your flow.
2. Use the Indicate on screen option to locate your PowerShell application on the desktop machine. 
3. In the Arguments field, use the following commands. Remember to replace the file path with the actual path on your machine. 
-- powershell.exe -NoProfile -NoExit -ExecutionPolicy Bypass -File <replace_file_path> -cipherText "${parseVaultPassword_2.password}" -isShared "${fetchPassword_1.isshared}" -displayValue "NO"
where, 
<replace_file_path> - Full path to the DecryptVault.ps1 file on your local machine. (e.g., C:\Users\Demo_user\Desktop\DecryptVault.ps1)
${parseVaultPassword.password} - password output from the parseVaultPassword custom function. 
${fetchPassword_1.isshared} - isshared output parameter from the Fetch Password action. (See the screenshot below.)
4. Use the Send hotkeys action (from the Web or Windows category) into the flow and configure it (Ctrl + V) to send the paste it into the input field.
5. Add any subsequent actions required for the login process, such as a Click action on the "Login" button.