This are step-by-step instructions on how to get the plugin working on any Bubble App.
- Add this plugin to your application.
- Add a Workflow action, for example 'When an element is clicked'.
- Search in the actions for 'Encode'.
- Put in the input property any dynamic data (for example the value of an input element)
- Add another action to store the encoded data in the database (you will need to select 'Result of step 1 encoded data').
- Search for another action, this time 'Decode'.
- In the input property of the action, search for the encoded data you just stored in database.
- Add another action to once-again store the decoded (original) data in the database (you will need to select 'Result of step 1 decoded data').
EncodeThis function takes a byte string (the input parameter) and encodes it according to base64. The base64.encode() function is designed to be fully compatible with btoa() as described in the HTML Standard.
DecodeThis function takes a base64-encoded string (the input parameter) and decodes it. The return value is in the form of a string containing only characters in the range from U+0000 to U+00FF, each representing a binary byte with values 0x00 to 0xFF. The base64.decode() function is designed to be fully compatible with atob() as described in the HTML Standard.
To base64-decode UTF-8-encoded data back into a Unicode string, UTF-8-decode is used for decoding it.
This plugin adds two actions for you
Encode &
Decode. You need to call any of these actions in the Workflow to encode or decode.
The
Encode action contains the following properties to be used:
- Input: A string-converted element to be encoded. Accepts all values from strings, numbers, and files.
The action also returns the following:
- Encoded Data: A string of the encoded element, previously defined in Input. Use this for a following decoding (e.g store encoded data in database for later decoding).
The
Decode action contains the following properties to be used:
- Input: Place here an encoded string. Only accepts a base64-encoded string.
The action also returns the following:
- Decoded: A decoded element. It will return whatever was encoded (text, number, file) in it's original format.