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

Populate field with attachment metadata and then delete attachment with Flow

I have a Power Apps form connected to a SharePoint list that's using attachments. I would like to attach a document that already grabs the Title metadata from the document's heading title. Instead of manually entering the Title in the form, I would like the Title field to be populated from the attached document's Title metadata. This is so that the SharePoint list item has the same title as the attached document.

Secondly and as asked in this thread, considering that Power Apps can't save attachments directly to a library, is it be possible to add an action to a Flow (one that copies an attachment from a list to a library) that then deletes the attachment from the list in order to avoid duplicates?

1 ACCEPTED SOLUTION

Accepted Solutions

Hi @user180618 :

Do you want to save the file into the SharePoint library then delete the attachment in the record?

I've made a test for your reference:

add a "Delete attachment" action

Id:When an item is created-ID

File Identifier:Get attachments-id

11111111111111.PNG

Best Regards,

Bof

View solution in original post

9 REPLIES 9
Frequent Visitor

Sorry for the thread bump. I take it the above is not possible?

Community Support
Community Support

Hi @user180618 

Do you want to use the name of the attachment as the default value when you are creating a new record in a form?

Could you tell me whether you will only add one attachment to each record?

I assume that my understanding is correct, it will become very simple, even without using flow.

Ive made a test for your reference:

Step1:

Set the DataCardValue42s Default property to :

 

 

First(DataCardValue46.Attachments).Name
/*DataCardValue42 is the DataInput control in Title Card.
DataCardValue46 is the Attachment control in Attachments Card. */

 

 

eeee.png

 

Since the above solution does not use a flow and does not create attachments repeatedly, you dont have to worry about needing to delete attachments from the list to avoid duplication.

Best Regards,

Bof

Thanks for the response @v-bofeng-msft. To clarify a bit, can the Datacard get any other information from the attachment other than the filename? For example, the Title metadata in an attached .doc file.

 

The flow is a separate thing. Basically, I would like the .doc file (attached in the form) to be saved in a SharePoint library. Since this is not possible in Power Apps and the only way is to use Flow to copy it from a List to a Library, can the flow also delete it from the List after it's been copied? That way, I'll have the attached .doc in the Library and not in the List.

Hi @user180618 :

Do you want to save the file into the SharePoint library then delete the attachment in the record?

I've made a test for your reference:

add a "Delete attachment" action

Id:When an item is created-ID

File Identifier:Get attachments-id

11111111111111.PNG

Best Regards,

Bof

View solution in original post

Thanks @v-bofeng-msft. One more thing: can the same flow also copy the list item's metadata to the library and apply it to the attachment?

Hi @user180618

Sorry I didn't understand your question. Could you explain it in detail?

Best Regards,

Bof

Thanks for the reply @v-bofeng-msft. To clarify, can the Flow get the attachment and get the List's column values into the Library? So the attachment that's copied to the Library (and then deleted using your flow) also takes with it the values in Column1, Column2 etc.

 

In other words, what I'm basically trying to achieve with all of the above is: make Power Apps save to a Library. Since that's not possible, I'm trying to do this by saving to a List, and then using a Flow to move the information (including the attachment) from the List to the Library.

Hi @user180618 :

OK.I may understand what you mean.

I suggest you try this action: update file properties

1.png

Best Regards,

Bof

Frequent Visitor

Thank you @v-bofeng-msft

 

I modified my attachment flow with the update properties and it worked like Magic! 

 

Thank you.

Helpful resources

Announcements
News & Announcements

Community Blog

Stay up tp date on the latest blogs and activities in the community News & Announcements.

Power Apps Community Call

Power Apps Community Call- January

Mark your calendars and join us for the next Power Apps Community Call on January 20th, 8a PST

PP Bootcamp Carousel

Global Power Platform Bootcamp

Dive into the Power Platform stack with hands-on sessions and labs, virtually delivered to you by experts and community leaders.

secondImage

Power Platform Community Conference On Demand

Watch Nick Doelman's session from the 2020 Power Platform Community Conference on demand!

Top Solution Authors
Top Kudoed Authors
Users online (10,633)