Reputation: 416
I am building a powerapp that will allow me to upload a picture as an attachment to a list item in sharepoint (office 365). The name of the Sharepoint list is "BeckTable", and it's basically a simple list that has 5 rows that contain the name and job title of those 5 people. I want the powerapp to allow those 5 users to add a picture attachment to their rows using this powerapp.
I followed the instructions on this site, and got to the point where I could use the camera control to take a picture. But the problem with the code below is that it doesn't seem to save the picture as an attachment on an existing list row. It seems to create a new row entirely with a link to the picture, and once I close the app, I can no longer access that picture.
This is the code that gets triggered when the user clicks on the camera in the app to take a picture:
ClearCollect(CameraImage,Camera1.Photo); UpdateContext({PhotoDateTime: Now()})
This is the code that gets triggered when the user clicks on the Upload Picture button that I created right below the camera control:
Patch(BeckTable, Defaults(BeckTable), {Title: TextInput1.Text, 'Image Info': First(CameraImage).Url})
This is the image data that I use to display a user's photo when you click on a particular row in the browse screen of the powerapp:
LookUp(BeckTable,Title= TextInput1.Text, 'Image Info')
Does anyone know why new rows are being created and what can I do to make these attachments stick to the existing rows rather than create new rows with pictures that disappear once I close the app?
Upvotes: 0
Views: 641
Reputation: 146
When you patch with Defaults it creates new row, you have to patch with a LookUp instead, so it referres to an existing item But I don't think you can patch attachment, you probably will have to use Form Search for reza camera to sharepoint on youtube, he explains it very well
Upvotes: 0