cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
_jesan_
Frequent Visitor

Issue parsing a JSON file from OneDrive for Business

I'm having some issues trying to parse a JSON file from OneDrive for Business

 

  • My flow triggers when a new file is created (All files in the folder are json type).
  • I use the next JSON file 
{"Prueba":"Hola mundo"}

 

 

json(base64ToString(trigger()['outputs']['body']['$content']))

 

  • When I run the flow I get the next message:
Unable to process template language expressions in action 'Compose' inputs at line '1' and column '2816': 'The template language function 'json' parameter is not valid. The provided value '{
"Prueba":"Hola mundo"
}' cannot be parsed: 'Unexpected character encountered while parsing value: . Path '', line 0, position 0.'. Please see https://aka.ms/logicexpressions#json for usage details.'.

 

  • I tried using the Parse JSON action having the same results

 

 

2 ACCEPTED SOLUTIONS

Accepted Solutions
Super User
Super User

Re: Issue parsing a JSON file from OneDrive for Business

hi @_jesan_  maeby I did what you want

 

base64ToString(triggerBody()?['$content'])

 

 

try.PNG

result.

ok.PNG 



Did I answer your question? Please consider to Mark
my post as a solution! to guide others :winking_face:

Proud to be a Flownaut!


If you want you can follow me at www.christianabata.com Quieres contenido en español? Síguenos en Power Automate LA

View solution in original post

Highlighted
_jesan_
Frequent Visitor

Re: Issue parsing a JSON file from OneDrive for Business

I've found the problem of the issue.
The program that creates JSON's files was using a utf-8 with BOM.
I created another file with flow and noticed this difference that file must be created with utf-8 codification.
Thanks four your replies.

View solution in original post

5 REPLIES 5
Super User
Super User

Re: Issue parsing a JSON file from OneDrive for Business

Hi @_jesan_ 

 

Could you please post a screenshot of your flow?  

 

Thanks



Did I answer your question? Mark my post as a solution!

If you liked my response, please consider giving it a thumbs up


Proud to be a Flownaut!

Learn more from my blog
Super User
Super User

Re: Issue parsing a JSON file from OneDrive for Business

hi @_jesan_  maeby I did what you want

 

base64ToString(triggerBody()?['$content'])

 

 

try.PNG

result.

ok.PNG 



Did I answer your question? Please consider to Mark
my post as a solution! to guide others :winking_face:

Proud to be a Flownaut!


If you want you can follow me at www.christianabata.com Quieres contenido en español? Síguenos en Power Automate LA

View solution in original post

Super User
Super User

Re: Issue parsing a JSON file from OneDrive for Business

Hello @_jesan_

@ChristianAbata is correct, after doing the steps he posted. You can add another compose action and use the expression:
json()
And inside the () you can put the dynamic content of the base64 output.
Than run the flow, copy the output from the Json expression.
Now you can add a parse JSON action and use the copied value as the sample payload.

—Josh
If you like my post please hit the "Thumbs Up" -- If my post solved your issue please "Mark as a Solution" to help others




Did I answer your question? Mark my post as a solution!

If you like my post please hit the Thumbs Up ?


Proud to be a Flownaut!





_jesan_
Frequent Visitor

Re: Issue parsing a JSON file from OneDrive for Business

Hi, I tried your aproach but I get same results

Imagen2.PNG

Result:

Imagen1.PNG

I noticed there's difference in each output action result when JSON is involved.
It seems that when a output is identified as a valid JSON the pair "name:value" is shown with color, but when I use the first Compose action it seems that this colors are not shown in the same way.

Imegen3.PNG

 

Highlighted
_jesan_
Frequent Visitor

Re: Issue parsing a JSON file from OneDrive for Business

I've found the problem of the issue.
The program that creates JSON's files was using a utf-8 with BOM.
I created another file with flow and noticed this difference that file must be created with utf-8 codification.
Thanks four your replies.

View solution in original post

Helpful resources

Announcements
MBAS Gallery 2020

MBAS Gallery 2020

Watch Microsoft Business Applications Summit sessions on-demand.

firstImage

New Ranks and Rank Icons released on April 21!

The time has come: We are finally able to share more details on the brand-new ranks coming to the Power Automate Community!

firstImage

Now Live: Power Virtual Agents Community!

We are excited to announce the launch of Power Virtual Agents Community. Check it out now!

firstImage

New & Improved Power Automate Community Cookbook

We've updated and improved the layout and uploading format of the Power Automate Cookbook!

thirdimage

Power Automate Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

sixthImage

Community Summit North America

The top training and networking event across the globe for Microsoft Business Applications

Top Solution Authors
Users online (7,281)