Base64Encode in javascript action

0
How to import and use Base64Encode in java script action?
asked
3 answers
1

Hi Tumpilli,

 

Assuming you go from string input to string output, you can make use of the btoa function in javascript to do the base64 encoding in your javascript action:

1. Create a Javascript action having the mentioned input and output.

2. Edit the Javascript to something like below

3. Use the Javascript Action in your nanoflows!

 

export async function JavaScript_action(input) {
	// BEGIN USER CODE
	return btoa(input);
	// END USER CODE
}

 

answered
0

Try the base64 encoding and decoding javascript action in the Nanoflow Commons module.

They do:

import { Base64 } from 'js-base64';
[...]
    return Base64.encode(stringInput);
[...]

 

answered
-1

hello team

Go to the App Explorer.

Right-click on JavaScript actions and select Add JavaScript action.Name your JavaScript action 

In the JavaScript action editor, define an input parameter for the string you want to encode.

Click on New under Parameters.

Name the parameter,

e.g., inputString.Set the type to String.

Open the microflow where you want to use the Base64 encoding.

Add a Call JavaScript Action activity to your microflow.

Select the Base64Encode action you created.

Map the input parameter to the string you want to encode.Store the result in a variable for further use in your microflow.

answered