cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
kbailey
Frequent Visitor

PowerApps Attachment file names to Sharepoint

Hi. I am using the attachment column from a Sharepoint list into my PowerApp. When testing the app, I take/add multiple photos to the attachment section. However, when I do this every photo is named "image" and when I submit the form, the Sharepoint list will only show me one out of three that I uploaded because all three have the same name. How can I get my live photo upload file names to build off each other? For instance, "image" "image1" "image2" etc... I would prefer if the user does not have to manually do this, if I could code something somewhere to where it can name the different photos based on upload time that would be great. Thanks! 

1 ACCEPTED SOLUTION

Accepted Solutions
v-yujincui-msft
Community Support
Community Support

Hi @kbailey ,

 

Do you want to add multiple photos taken from your phone via Flow to the Attachments column in SharePoint List? I have made a test for your reference.

 

1. Here is my Flow.

vyujincuimsft_0-1651632856578.png

2. Add a Camera Control to the Form and apply the following formula on its OnSelect property as:

Collect(colimages,{PhotoName:Text(Now(),LongDateTime)&".jpg",PhotoValue:Substitute(Last(Split(JSON(Camera1.Photo,JSONFormat.IncludeBinaryData),"base64,")).Result,"""","")});

3. Select the Form and apply the following formula on its OnSuccess property as:

Set(itemid,Form2.LastSubmit.ID);
ForAll(colimages,CameratoSP.Run(itemid,PhotoName,PhotoValue))

vyujincuimsft_1-1651633626472.png

Result Screenshot:

vyujincuimsft_2-1651633811773.png

vyujincuimsft_3-1651633829176.png

 

 

Best Regards,
Charlie Choi

View solution in original post

4 REPLIES 4
WarrenBelz
Super User
Super User

HI @kbailey ,

Attachments controls uploads should use the current file name of the item selected. How are you uploading them?

I am taking a photo and clicking "use photo" and if I take multiple photos it labels my uploads all under the name "image"

@kbailey ,

Is this on a mobile device ? If so I am not aware of any solution as the naming is in the control of the device.

 

Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

Visit my blog Practical Power Apps

v-yujincui-msft
Community Support
Community Support

Hi @kbailey ,

 

Do you want to add multiple photos taken from your phone via Flow to the Attachments column in SharePoint List? I have made a test for your reference.

 

1. Here is my Flow.

vyujincuimsft_0-1651632856578.png

2. Add a Camera Control to the Form and apply the following formula on its OnSelect property as:

Collect(colimages,{PhotoName:Text(Now(),LongDateTime)&".jpg",PhotoValue:Substitute(Last(Split(JSON(Camera1.Photo,JSONFormat.IncludeBinaryData),"base64,")).Result,"""","")});

3. Select the Form and apply the following formula on its OnSuccess property as:

Set(itemid,Form2.LastSubmit.ID);
ForAll(colimages,CameratoSP.Run(itemid,PhotoName,PhotoValue))

vyujincuimsft_1-1651633626472.png

Result Screenshot:

vyujincuimsft_2-1651633811773.png

vyujincuimsft_3-1651633829176.png

 

 

Best Regards,
Charlie Choi

Helpful resources

Announcements
Power Platform Conf 2022 768x460.jpg

Join us for Microsoft Power Platform Conference

The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.

May UG Leader Call Carousel 768x460.png

June User Group Leader Call

Join us on June 28 for our monthly User Group leader call!

PA Virtual Workshop Carousel 768x460.png

Register for a Free Workshop

This training provides practical hands-on experience in creating Power Apps solutions in a full-day of instructor-led App creation workshop.

PA.JPG

New Release Planning Portal (Preview)

Check out our new release planning portal, an interactive way to plan and prepare for upcoming features in Power Platform.

Top Solution Authors
Users online (1,606)