Forum Discussion
Ceres2186489
Jun 11, 2024Copper Contributor
Office Script to add image
Hi! I am using the following code to add image into excel sheet automatically. However, it only works for JPG file and not for JPEG and PNG file. May I modify the following code and let it works for ...
JKPieterse
Jun 11, 2024Silver Contributor
I assume this script is called from a Power Automate flow? If yes, you must make sure the image file is properly converted to a base64ImageString.
- Ceres2186489Jun 12, 2024Copper Contributor
JKPieterse Thanks for your reply. Here is my flow:
After get attachment content from SharePoint list item, Base64() is used to convert
outputs('Get_attachment_content')?['body']. The base64() is extracting coding of outputs('Get_attachment_content')?['body']?['$context']. However, this flow is still only function for JPG file. How can I make this work for PNG file? Thanks a lot.- JKPieterseJun 12, 2024Silver ContributorApparently that image function doesn't support that picture format. Perhaps there is a flow step that can do the conversion before this step?