cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
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
Highlighted
Super User III
Super User III

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
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
Highlighted
Super User III
Super User III

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
Highlighted
Super User III
Super User III

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
Super User III
Super User III

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!


Check out my blog for Power Automate tips, tricks, and guides
FlowAltDelete




Highlighted
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
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
firstImage

Super User Program Update

Three Super User rank tiers have been launched!

firstImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

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!

Top Solution Authors
Top Kudoed Authors
Users online (8,382)