I am trying to attach a photo in my form and patch to a SharePoint list. However, I am unable to display the photo after it is patch to sp list. does anyone know why?
I have tried searching online and most of the solutions involve a power automate flow function, is there any way that we can resolve without using power automate?
Solved! Go to Solution.
Hi @bluehoodie :
Do you want to patch the SharePoint list with the images?
Firstly ,let me explain why it is difficult to patch images to SharePoint lists.
Since the data source is SharePoint, It is not feasible to update the Picture field with an image file in canvas app.
In addition, you can update Hyperlink field with URI.
I think this link will help you a lot :
Secondly,I have an idea here for your reference:
My Date Source:” List A”
1\Add a Add picture control(For testing purposes, I use picture control instead of Camera control)
2\Add a button.
OnSelect:
Collect(
MyPics, /*create a collection to save the pic*/
{
DisplayName: Concatenate(
"image",
Text(
Now(),
"[$-en-US]yyyy-mm-dd-hh-mm-ss"
),
".jpg"
),
Value: UploadedImage1.Image,
AbsoluteUri: "",
Id: "00000000-0000-0000-0000-000000000000"
}
)
3\Add a Gallery
Items: MyPics
4\Add a Form(Form1)
DefaultMode: FormMode.Edit
DataSource :'List A'
Item: LookUp('List A',ID=1) /* Specify records to update */
set the attachments control’s Items property to: MyPics(Important!Refer to the picture attachment for detailed settings)
Visible: false /* Make the entire form invisible (beautiful consideration)*/
4\Add a button
OnSelect:
SubmitForm(Form1);
Patch(
'List A',
LookUp( /* Specify records to update */
'List A',
ID = 1
),
{
column1: First(
LookUp( /* Specify records to update */
'List A',
ID = 1
).Attachments
).AbsoluteUri/*patch the column1 field with the first pic's URI*/,
column2: Last(
FirstN(
LookUp( /* Specify records to update */
'List A',
ID = 1
).Attachments,
2
)
).AbsoluteUri/*patch the column2 field with the second pic's URI*/,
column3: Last(
FirstN(
LookUp( /* Specify records to update */
'List A',
ID = 1
).Attachments,
3
)
).AbsoluteUri/*patch the column3 field with the third pic's URI*/
}
)
I think this link will help you a lot:
Best Regards,
Bof
Hi blue
Hopefully I'm wrong, but I dont think this is possible (yet).
We do some photo from powerapps to library, but we have to use Power Automate.
Its not very complicated.
The photo is attached to a list item.
A flow activates when a new item is created or an item is changed
Flow copy the attachment to a Library and then remove it from the list.
Also, remember to tag the photo with the list ID if you need this.
Let me know if you want a more detailed explanation :).
Best regards
Tommy
Hi @bluehoodie :
Do you want to patch the SharePoint list with the images?
Firstly ,let me explain why it is difficult to patch images to SharePoint lists.
Since the data source is SharePoint, It is not feasible to update the Picture field with an image file in canvas app.
In addition, you can update Hyperlink field with URI.
I think this link will help you a lot :
Secondly,I have an idea here for your reference:
My Date Source:” List A”
1\Add a Add picture control(For testing purposes, I use picture control instead of Camera control)
2\Add a button.
OnSelect:
Collect(
MyPics, /*create a collection to save the pic*/
{
DisplayName: Concatenate(
"image",
Text(
Now(),
"[$-en-US]yyyy-mm-dd-hh-mm-ss"
),
".jpg"
),
Value: UploadedImage1.Image,
AbsoluteUri: "",
Id: "00000000-0000-0000-0000-000000000000"
}
)
3\Add a Gallery
Items: MyPics
4\Add a Form(Form1)
DefaultMode: FormMode.Edit
DataSource :'List A'
Item: LookUp('List A',ID=1) /* Specify records to update */
set the attachments control’s Items property to: MyPics(Important!Refer to the picture attachment for detailed settings)
Visible: false /* Make the entire form invisible (beautiful consideration)*/
4\Add a button
OnSelect:
SubmitForm(Form1);
Patch(
'List A',
LookUp( /* Specify records to update */
'List A',
ID = 1
),
{
column1: First(
LookUp( /* Specify records to update */
'List A',
ID = 1
).Attachments
).AbsoluteUri/*patch the column1 field with the first pic's URI*/,
column2: Last(
FirstN(
LookUp( /* Specify records to update */
'List A',
ID = 1
).Attachments,
2
)
).AbsoluteUri/*patch the column2 field with the second pic's URI*/,
column3: Last(
FirstN(
LookUp( /* Specify records to update */
'List A',
ID = 1
).Attachments,
3
)
).AbsoluteUri/*patch the column3 field with the third pic's URI*/
}
)
I think this link will help you a lot:
Best Regards,
Bof
User | Count |
---|---|
253 | |
113 | |
92 | |
48 | |
38 |