I am attempting to mimic what has been reported as a working flow.
I have created a copy and am getting the following error specific to the json 'compose' action.
There is a 'compose' action in the example flow with tthe following code -
json(outputs('Send_an_HTTP_request_to_SharePoint')?['body']['d']['ImageColumn'Name])
In my version of the flow PA is kicking back the following error when I use the above with my column name included -
Unable to process template language expressions in action 'Compose' inputs at line '0' and column '0':
'The template language expression 'json(outputs('Send_an_HTTP_request_to_SharePoint')?['body']['d']['CompanyLogo'])' cannot be evaluated because property 'CompanyLogo' doesn't exist, available properties are 'results'.
When I change the compose language to the following -
json(outputs('Send_an_HTTP_request_to_SharePoint')?['body']['d']['result')
I get the following error. (when I enter "results" PA defaults it to the singular 'result' on update, which is why it reads as it does).
Compose Error:
Unable to process template language expressions in action 'Compose' inputs at line '0' and column '0': 'The template language expression 'json(outputs('Send_an_HTTP_request_to_SharePoint')?['body']['d']['result'])' cannot be evaluated because property 'result' doesn't exist, available properties are 'results'.
Compose Detail:
Solved! Go to Solution.
You likely need to convert the image to base64 encoding. See example below where I have an image in my library that I use when sending an email. It will be the same process when adding to your PDF.
Get file content gets the actual content of the image.
Compose builds up the URL including the base64 part. The expression used here is:
<img src="data:image/jpeg;base64,@{outputs('Get_file_content')?['body']?['$content']}" alt="My Image" />
It then sends an email using the output from the Compose.
The final result of the email in this instance is:
Where you've written the word outputs, you need to put the actual field name in there that contains the image URL.
Hey @Phineas
The line is saying available properties are results, result with an s. You have just written result.
Write this expression:
json(outputs('Send_an_HTTP_request_to_SharePoint')?['body']['d']['results'])
By writing the s you won't get the error now.
I finally got it to take. Tried all morning and it kept dropping the 's'.
Now the error is -
Unable to process template language expressions in action 'Compose' inputs at line '0' and column '0': 'The template language function 'json' expects its parameter to be a string or an XML. The provided value is of type 'Array'.
Send an HTTP Details -
If the Compose is just trying to get the results, then you shouldn't have it within a json expression as it's already in JSON format. You can just use the following expression:
outputs('Send_an_HTTP_request_to_SharePoint')?['body']['d']['results']
Edited Reply No. 2:
Went round and round and got it back to the following.
It's cleaned up from the original, however the original problem still exists - the 'Logo' does not appear at the top of the PDF file as an image as desired.
SharePoint Library:
PDF Conversion:
In your Compose 2 you aren't setting up the image tag correctly. See format below:
//You would replace CompanyLogo.jpg with your actual logo, etc.
<img src="CompanyLogo.jpg" alt="Company Logo" width="500" height="600">
I installed your recommendation exactly as you have provided.
It only made image the size called out in the code.
The image still does not appear.
You don't have to add the width and height - that was just an example of what an image tag is constructed.
You will need to add your actual Company Logo URL as you had before. At the moment you've just got the text CompanyLogo.jpg.
I took this link directly from the file in the SP Library.
This was the result -
You likely need to convert the image to base64 encoding. See example below where I have an image in my library that I use when sending an email. It will be the same process when adding to your PDF.
Get file content gets the actual content of the image.
Compose builds up the URL including the base64 part. The expression used here is:
<img src="data:image/jpeg;base64,@{outputs('Get_file_content')?['body']?['$content']}" alt="My Image" />
It then sends an email using the output from the Compose.
The final result of the email in this instance is:
Thank you for the reply.
I tried to mimic what you did. I didn't get 'Outputs' as an option and had to manually enter all the information in the 'compose' action.
Still no image in PDF.
Where you've written the word outputs, you need to put the actual field name in there that contains the image URL.
User | Count |
---|---|
94 | |
39 | |
24 | |
22 | |
16 |
User | Count |
---|---|
128 | |
49 | |
48 | |
32 | |
24 |