In this article we are going to approach a way to upload some images to a SharePoint list(using a text column) and show them back in a gallery.
First, create a canvas app and insert the following controls:
- Text input
- Button ( “Create” )
- Horizontal Gallery ( linked to your Sharepoint list )
On the button “OnSelect” function it should look like this:
Here we patch the Column “Image” with the based64 string of the uploaded image using the JSON() and removing the extra double quotes. With mobile devices the “Add picture” control let us use the camera, just set the ‘UseMobileCamera’ property from the “AddMediaButton” to true.Above is an image with a text overlay. Click inside the image to replace the text with your own.
On your list it should be like below:
To show the image in the Gallery, simply “call” the column with the base64 string.
And that’s it! You can store and show Images on your App using only one Sharepoint list.
Author: Henrique Serafim