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 Apps News & Annoucements carousel

Power Apps News & Announcements

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

Community Call Conversations

Introducing the Community Calls Conversations

A great place where you can stay up to date with community calls and interact with the speakers.

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 (4,296)