cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
bluehoodie
Resolver II
Resolver II

Patch a photo to SP List.

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?

1 ACCEPTED SOLUTION

Accepted Solutions
v-bofeng-msft
Community Support
Community Support

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.

2.JPG
I think this link will help you a lot :

SharePoint/Known issues

Secondly,I have an idea here for your reference:
My Date Source:” List A”

3.JPG
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)

1.png
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:

https://powerusers.microsoft.com/t5/Building-Power-Apps/Storing-Images-from-a-gallery-into-columns-i... 

Best Regards,

Bof

View solution in original post

2 REPLIES 2
TurboTape
Resolver I
Resolver I

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

v-bofeng-msft
Community Support
Community Support

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.

2.JPG
I think this link will help you a lot :

SharePoint/Known issues

Secondly,I have an idea here for your reference:
My Date Source:” List A”

3.JPG
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)

1.png
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:

https://powerusers.microsoft.com/t5/Building-Power-Apps/Storing-Images-from-a-gallery-into-columns-i... 

Best Regards,

Bof

Helpful resources

Announcements
Power Apps News & Annoucements carousel

Power Apps News & Announcements

Keep up to date with current events and community announcements in the Power Apps community.

Power Apps Community Blog Carousel

Power Apps Community Blog

Check out the latest Community Blog from the community!

Top Solution Authors
Top Kudoed Authors
Users online (3,279)