Parsing a JSON file
To start, we need to convert the base64
string into a human-readable version. Thankfully, Power Platform offers some built-in functions that allow us to decode and encode base64
.
Add a new Compose block and change to the Expression tab (see Figure 5.5):
Figure 5.5 – Power Automate expression editor
First, add the decodeBase64
function, then the base64
function, since we need to understand that the content is not just a string but an encoded base64
text. Finally, change to the Dynamic content tab and click on the File Content output of your FTP connector. The full line should look like this:
decodeBase64(base64(outputs('Get_file_content')?['body']))
In this formula, the Get_file_content
piece is equal to the name of the FTP action that retrieves the file.
This will return the content of the file, which for this example is as follows:
[ { &...