I have an app that lets me save the picture taken by a camera. The strange thing is how when I run this code:
It will only work on the camera object's OnSelect. I have a camera Icon here that does the same thing but for some reason it doesn't work.
When I click the OnSelect for the camera object, my SharePoint List gets updated correctly.
But when I do an OnSelect on the camera icon, it doesn't work and is blank. What I don't get is they're both essentially doing the same thing; running the same code. But why does this work on the OnSelect for the camera object but not for the icon?
Solved! Go to Solution.
Hi @Mgodby ,
I have the answer as a solution for you in that you will stop trying to solve it.
As I suspected, the Camera.Photo does not happen until you "click" the camera control.
I created a new control and tried firstly clicking the button before the control and as you have experienced, got an invalid record.
I then clicked the camera (which had no other code on it to Collect), then clicked the button and got a photo.
There is also another property called .Stream, but it seems to work in the same way.
If this post helps, then please consider Accept it as the solution to help the other members find it more. It also closes the item.
Hi @Mgodby ,
There must be something else in the background as the code is simply adding the photo from the camera to a collection within the app - it is not writing anything to SharePoint. I use almost exactly the same principle and have had about 30,000 photos written to SharePoint Library with a Flow from the collection.
The button should work as well - however we need to find what is writing to SharePoint - by the looks of your code, it is writing the JSON IncludeBinaryData conversion or similar to a multi line text field in a list. Check what other things are being triggered - can you give me a screen shot of what you are dong?
Hi @Mgodby ,
Sorry I will retract the SharePoint bit - misread your message.
However I believe possibly that to take a picture, you have to select the camera control. I have always used this anyway and it has been intuitive for users without any instructions.
Any reason for wanting to use a button? I will also give this a test on my end.
Hi @Mgodby ,
I have the answer as a solution for you in that you will stop trying to solve it.
As I suspected, the Camera.Photo does not happen until you "click" the camera control.
I created a new control and tried firstly clicking the button before the control and as you have experienced, got an invalid record.
I then clicked the camera (which had no other code on it to Collect), then clicked the button and got a photo.
There is also another property called .Stream, but it seems to work in the same way.
If this post helps, then please consider Accept it as the solution to help the other members find it more. It also closes the item.
I think you're right. It is more intuitive to just click the camera. It really shouldn't be an issue since they can still take a photo and do all they need. I guess I was just confused as to why this was occurring since they both have the same code in OnSelect. Thank you for all the help.
User | Count |
---|---|
151 | |
94 | |
85 | |
77 | |
58 |
User | Count |
---|---|
193 | |
175 | |
105 | |
95 | |
90 |