How To Convert Data URI To String Format

Power fx expression for converting dataUriToString() . 

This scenario is mainly used to find the name, location of resource file which is in uniform format for websites. 


High level resolution steps 

The given input gets converted from text to dataUri format with compose action.

Then converted dataUri format gets converted to string format with another compose action.


Detailed resolution steps 

Step 1 

Add a “manually a trigger flow” in power automate, click on add input.


Step 2

Add compose as action, (‘+’button) ,under input dialogbox the expression tab will be available and then type : dataUri(triggerBody()[‘text’]).


Step 3

Add another compose as action,(‘+’ button) under input dialogbox the expression tab will be available and then type : dataUriToString(outputs(‘Compose’)) as shown below.


Step 4

Then save and run the flow with input example “Hi, how are you?”.  


Output

We get output in the form of dataUri where, 

(data:text/plain is data:content/type,

charset=utf-8 is character encoding system to represent as ASCII text, 

base64 ‘converts binary data to text’ and 

SGksIGhvdyBhcmUgeW91Pw == is for input Hi,how are you?).


After converting input to dataUri() form. When we use compose of dataUriToString() form, it returns back in the form of string for output as shown below.