cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Powerapps_Dan
Helper I
Helper I

Shoutouts Canvas App - Patch image to SharePoint List as item Attachment

Hi all,

 

Currently using the Shoutouts canvas app and have migrated the data collected to a SharePoint List.

 

I would like to have the images uploaded in a shoutout to be added to the SharePoint list item as an attachment and then be shown in the activity feed screen when clicking the show photo button.

 

Any help would be greatly appreciated! 

 

2021-06-18 14_52_17-Window.png

 

 

        // Write to data source
        Patch(Shoutouts, Defaults(Shoutouts),
            {
                Title: Value(Text(Now(), "[$-en-US]yyyymmddhhmmss")), 
                CreatorEmail: _myProfile.UserPrincipalName, 
                PrimaryID: Value(Text(Now(), "[$-en-US]yyyymmddhhmmss")), 
                CreatedOnDateTime: Text(Now(),"[$-en-US]dd/mm/yyyy hh:mm AM/PM"), 
                ShoutoutType: _selectedShoutout.Type, 
                RecipientEmail: _selectedUser.UserPrincipalName, 
                Image: UploadedImage1.Image, 
                CreatorName: _myProfile.DisplayName, 
                RecipientName: _selectedUser.DisplayName, 
                Message: MessageInputBox.Text
            }

 

 

2021-06-18 14_56_53-Window.png

 

//ThisItem.Image is a unique string identifier for the particular row's image. If showing the image, add the string to the _shownImagesActivity variable, otherwise remove it
If(ThisItem.Image in _shownImagesActivity, Set(_shownImagesActivity, Substitute(_shownImagesActivity, ThisItem.Image, "")), Set(_shownImagesActivity, _shownImagesActivity & ThisItem.Image))

 

 

2021-06-18 15_00_52-Window.png

 

 

ThisItem.Image

 

 

9 REPLIES 9
v-jefferni
Community Support
Community Support

Hi @Powerapps_Dan ,

 

If you want to add a attachment to a SP list item using Patch function directly, I afraid that there is no way to achieve your needs in PowerApps currently.

 

If you would like this feature to be added in PowerApps, please submit an idea to PowerApps Ideas Forum:

https://powerusers.microsoft.com/t5/PowerApps-Ideas/idb-p/PowerAppsIdeas

 

Hope this helps.

 

Best regards,

Community Support Team _ Jeffer Ni
If this post helps, then please consider Accept it as the solution to help the other members find it.

Powerapps_Dan
Helper I
Helper I

Hi @v-jefferni ,

 

Thanks for providing that information.

 

Is there any other way to get this to work with a sharepoint list? Doesn't have to be as an attachment, just any way of storing the image in the sharepoint list and viewing it in the Shoutouts activity feed? 

Hi @Powerapps_Dan ,

 

There should be an Image column in your SP list which could be used to store the image uploading via Patch function, the original patch formula:

// Write to data source
        Patch(Shoutouts, Defaults(Shoutouts),
            {
                Title: Value(Text(Now(), "[$-en-US]yyyymmddhhmmss")), 
                CreatorEmail: _myProfile.UserPrincipalName, 
                PrimaryID: Value(Text(Now(), "[$-en-US]yyyymmddhhmmss")), 
                CreatedOnDateTime: Text(Now(),"[$-en-US]dd/mm/yyyy hh:mm AM/PM"), 
                ShoutoutType: _selectedShoutout.Type, 
                RecipientEmail: _selectedUser.UserPrincipalName, 
                Image: UploadedImage1.Image,  //This is uploading an image to Image column
                CreatorName: _myProfile.DisplayName, 
                RecipientName: _selectedUser.DisplayName, 
                Message: MessageInputBox.Text
            }

 

Best regards,

Community Support Team _ Jeffer Ni
If this post helps, then please consider Accept it as the solution to help the other members find it.

Hi @v-jefferni ,

 

I've got a "Image" column in my sharepoint list, however if I have the column type as a image type column it is not detected when trying to patch to it (error appears in the code above saying the column does not exist).

 

Changing the column type to multiple lines of text allows it to be detected and allows patching to it, however "appres://blobmanager/xxxxx" is what is patched to it and the image is not viewable in the list or in the shoutouts app. 

 

Apologies I'm fairly new to powerapps, so I'm probably doing something simple wrong.

 

Thanks for your help so far!

Corissandageri
Post Patron
Post Patron

Reza has a good video on saving photo as attachments, I have made it work with the image control too.

 

https://www.youtube.com/watch?v=iW9dpDntKrY

Hi @Powerapps_Dan ,

 

Actually "appres://blobmanager/xxxxx" could be displayed in an Image control in Power Apps:

vjefferni_0-1624343296033.png

 

It just could not be displayed in a SharePoint list as an picture.

 

Could you please test and show me what's in the list Image column if you have uploaded an image with the App?

 

Best regards,

Community Support Team _ Jeffer Ni
If this post helps, then please consider Accept it as the solution to help the other members find it.

 

 

 

Hi @v-jefferni ,

 

This is what's in the sharepoint list image column:

appres://blobmanager/6a292ea042c444ffaa2251b7a26f2616/174

 

 

 

 

Hi @Powerapps_Dan ,

 

I have made a test and confirmed that it could be displayed in Power Apps Image control:

vjefferni_0-1624346515891.png

vjefferni_1-1624346570003.png

 

Have you refreshed the SharePoint list connection in Power Apps studio after changing the column type? If no, please have a try and test it again.

vjefferni_2-1624346741522.png

 

Hope this helps.

 

Best regards,

Community Support Team _ Jeffer Ni
If this post helps, then please consider Accept it as the solution to help the other members find it.

 

Powerapps_Dan
Helper I
Helper I

Hi @v-jefferni ,

 

Unfortunately still no luck, I've refreshed the data source and the images are still not coming through.

 

2021-06-24 10_50_07-Blue Bus Shoutouts - Saved (Unpublished) - Power Apps.png2021-06-24 10_51_38-Blue Bus Shoutouts - Saved (Unpublished) - Power Apps.png

 

 

Helpful resources

Announcements
PA_User Group Leader_768x460.jpg

Manage your user group events

Check out the News & Announcements to learn more.

Power Query PA Forum 768x460.png

Check it out!

Did you know that you can visit the Power Query Forum in Power BI and now Power Apps

Carousel 2021 Release Wave 2 Plan 768x460.jpg

2021 Release Wave 2 Plan

Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.

Users online (2,876)