Ready to elevate your business with Power Platform solutions?
Unlock the full potential of your operations!
Book a FREE consultation call with our experts today.
You maybe thinking why not just use the attachment feature you may want to do this for many reasons:
The below image demonstrates the difference between using the attachments method and the image column method in a SharePoint list, the attachment doesn’t show the name of the image or the image only the paper clip to indicate that a file has been attached to the list item, the image column displays a thumbnail of the image when clicked this will enlarge, providing a much better user experience, and less clicks needed for the user to be able to see the attached content.
Adding documents, images and the files to a SharePoint list entry through Power Automate is fairly straight forward, you can just use the file upload question in Forms, then in Flow get the file content through the Parse JSON Action then use the ID from that output to get the file content using the ‘Get File Content from ID’ then add that file content to SharePoint using the Add Attachment action.
From an automation view point It becomes challenging when the form has an image which you really want to sit inside a SharePoint Image column so that it shows in the SharePoint List view or SharePoint Gallery view as an image instead of a paper clip, instead of the attachment facility, you may want to do this for many reasons one reason could be to show the image thumbnail inside the list view or gallery view of the list
We walk you through how to get images out of Microsoft forms and into the image column in SharePoint, after researching this topic for a fair while and not really finding too much help online we thought it might be useful to share how we tackled this problem
Parse JSON template code
Get details from form the form needs to include a file upload question and also this needs to be set to image formats only otherwise the flow will fail.
Create Item – Create the SharePoint Item, with the relevant details.
Parse JSON from the file uploaded to the form, this still allows us to get the file ID and other document properties, so that we are able to then create the file.
In the SharePoint List get the list folder by creating a new list item and ensure you add a picture when adding the new item.
Next go to site contents then to site assets and you will see a folder with a long string of text and numbers open this folder you should see the image you just added, go back a folder level click the details of the folder and copy that long list ID for use in the create file step.
The most challenging aspect of this workflow is the custom HTTP action which essentially links the image file to the list attachments repository which in turn allows for the association to the image column, we need to configure the ‘Send an HTTP request to SharePoint’ action, use the button to download the text file containing all the code requirements to configure this action.
Uri -needs to include all of what you see on the left for the GetByTitle(‘List Name’)/Items(Id of the sharepoint item created)
serverUrl – Should be the URL for your SharePoint Site where the list is located.
serverRelativeUrl – Should be the directory you added the document to earlier it will need to be formatted similar to the image on the left ‘/siteassets/Lists/ListID’
The name elements come form the outputs from the parse JSON action.
Depending on the needs of the workflow or application, using the standard attachments method may work fine but for those solutions that require uses to administer data in a list view working with images in an image column could be a better solution, with this you can still use the attachment’s function for other related documents or additional images.
Always refer to the official documentation and guides for the most accurate and up-to-date information.
We hope you found this blog useful if you have any questions regarding the content of this blog please reply to us on Linked In.
If you want to learn more about SharePoint Lists we have wrote a blog covering just that you can read here.
Would you like training on SharePoint for your teams? or do you need help setting up your SharePoint knowledge resource and guidance on how to best use the built in tools, schedule a consultation today