Extracting $content value from JSON in “File Content” when using the SharePoint “Get file content using path” action

Ershad Nozari 426 Reputation points
2020-12-22T05:39:37.69+00:00

I'm using the "Get file content using path" to retrieve a PDF document from SharePoint.

50288-image.png

In the subsequent "Set variable" action I then need to access the value of the $content property to build a json request like so:

50266-image.png

This is currently not working for me as I am getting the following error in the "Parse JSON" action at runtime:

BadRequest. The property 'content' must be of type JSON in the 'ParseJson' action inputs, but was of type 'application/pdf'.

The schema for my Parse JSON action looks as follow:
50344-image.png

How can get the value of $content property from the "File Content" action output?

By the way below does not work
50313-image.png
as my JSON ends up like this:

  "Attachments": [  
    {  
      "AttachmentData": {  
        "$content-type": "application/pdf",  
        "$content": "JVBERi0xLjQN......."  
      },  
      "AttachmentName": "Hollow.pdf"  
    }  
  ]  
Azure Logic Apps
Azure Logic Apps
An Azure service that automates the access and use of data across clouds without writing code.
3,542 questions
{count} votes

Accepted answer
  1. Ershad Nozari 426 Reputation points
    2020-12-22T23:44:05.623+00:00

    @Pramod Valavala Thanks for response. I solved it by using the expression: outputs('Get_file_content_using_path')?['body']?['$content']

    1 person found this answer helpful.
    0 comments No comments

0 additional answers

Sort by: Most helpful

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.