cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
_jesan_
Level: Powered On

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

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 

View solution in original post

_jesan_
Level: Powered On

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!



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 

View solution in original post

Jcook
Level 10

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
_jesan_
Level: Powered On

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

 

_jesan_
Level: Powered On

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

Better Together Contest Finalists Announced!

Congrats to the finalists of our ‘Better Together’-themed T-shirt design contest! Click for the top entries.

firstImage

Incoming: New and improved badges!

Look out for new contribution recognition badges coming SOON!

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
Top Kudoed Authors
Users online (6,291)