Currently developing an app where I must upload images to sharepoint. To achieve this I have created and implemented a flow based on the "Upload an image to sharepoint" template. The flow runs, and even uploads the stored image (Stored in variable).
However, when I open the created record the images display as a black box with a white outline.
When I download the image, there is something in the file. But it shows as blank in photos.
Really confused as to what's going on.
First, I assume from the screenshot that you are taking the image using the camera, and not acutally uploading an image file. Uploaded image files require a different strategy.
Second, are you actually storing the image as a variable or using a collection? I've done this successfully, but always used a collection to store the filename and the photo itself. Then passed those two parameters to the Flow as you are doing.
Everything else looks right. But I would try saving the photo as a collection record rather than a variable. Like this
Then invoke the flow like this
Yes, the images being uploaded are from the camera. And not an image file. Only one image was uploaded by an image file and that was as a test after I realised something was wrong!
Also, I am storing the image using a variable. The variable is called TakenPic. To make sure this was working, I added an image control where I passed the variable to display TakenPic.
Interesting! I never thought of using a collection as part of the flow. I've tried to patch the image from a collection directly, but it was just a headache. (Hence why I have settled on using flow instead)
I will give your suggestion a go and get back to you.
Thank you very much for your response!
I was able to give your suggestion a try. But I think I've done something wrong. The flow is now failing to run. (See below for full error)
The code I added is:
Take Photo Button:
Run Flow Button:
UploadImage.Run(First(mypics1).Name & ".JPEG",First(mypics1).Pic)
I have tried the button without the ampersand, still receive the same error.
The error in flow says:
"Unable to process template language expressions in action 'Create_file' inputs at line '1' and column '1925': 'The template language function 'dataUriToBinary' expects its parameter to be formatted as a valid data URI. The provided value '' was not formatted correctly. Please see https://aka.ms/logicexpressions#dataUriToBinary for usage details.'."
Here's a picture of the Flow that works for me. Make sure its set up to pass two parameters.
You'll notice that I'm doing the DataURI conversion and storking that using Compose rather than trying to do it in the File Content Property itself. That could also be your problem.
It seems we're making progress.
The flow is still failng to execute, but for a different reason this time.
I'm getting the error:
'The template language function 'dataUriToBinary' expects its parameter to be formatted as a valid data URI. The provided value 'Tester' was not formatted correctly.
I got the same error when I had the ampersand with .jpeg also.
Image is from the camera control, so I'm confused as to why it's not recognising it as a valid URI.
The & ".jpeg" was to make sure it had a jpeg extension on the filename when you created it. Otherwise SahrePoint wouldn't recognize it when you tried to open it. If it thinks the Data URI you passed was "Tester" then I suspect you are passing the wrong parameter or passing them in the wrong order. If you look at the collection do you actually see the photo? If you do then the data is there, but its not being passed right.
Not really. It should look something like this
Ahhh ha! Now we know where the issue is. It had nothing to do with flow. It has to be something to do with the camera control not capturing images correctly.
Wonder if it's something to do with the streamrate? I have it set to 100.
What I think I'll try is redoing the camera controls.
Really appreciate all of the assistance on this by the way!
Continue your learning in our online communities.
Next Wednesday, September 18th at 8am PDT
Features releasing from October 2019 through March 2020
Coming to a city near you
Fill out a quick form to claim your user group badge now!
Connect, share, and learn with your peers year-round
Register by September 5 to save $200