cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
miketondu
Level: Powered On

Sharepoint create and update file properties

I get several emails everyday with 1 to 6 pdf attachments all in the same format, and the body of the email contains 1 to 6 strings corresponding to each attachment.    

 

I need to create a sharepoint file for each attachment in a shared library and update the file's properties by splitting each string to get the info for each column.  I can split each string by turning it into an array,  but im having the hardest time creating the files and having the strings go into the columns/properties for each one.  

 

Here is a screenshot of what I've been working on, some help would be very appreciated.  

 

55oC0pyySymHB0HcDXepcA_thumb_663d.jpg

Let me know if you require any additional information! 

9 REPLIES 9
Gristy
Level 10

Re: Sharepoint create and update file properties

With what you have so far - what is successful and what fails?

AKRogers
Level 8

Re: Sharepoint create and update file properties

Hi @miketondu,

 

As the poster before me mentioned, some extra information on what is failing would be very helpful!  However, right off the bat I can suggest a couple of things to make this easier on you:

 

  • Rename your actions, particularly all those Compose actions.  You want something like "Compose: Requester" or "Compose: Department."  That way you'll be able to see at a glance in the Dynamic Content window which of the compose actions "Outcomes" is correct for each field you want to update.  
  • Use the correct ID in the Update Action.  The "Create file" action will generate an ID, and that's the one you want to use in your Update File Properties action.

 

Take care!

Ashley

 

If this response provided an answer to your question please mark it as a solution so that others can find it.

If you found this helpful, consider giving it a thumbs up!

Community Support Team
Community Support Team

Re: Sharepoint create and update file properties

 

Hi @miketondu ,

 

Would you like to show us the details of the Flow configuration to illustrate your needs and tell us what is the problem you are currently experiencing?

 

Best Regards,

Community Support Team _ Barry
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
miketondu
Level: Powered On

Re: Sharepoint create and update file properties

I get the 1-6  strings into an array and then proceed to split each one in the required manner to get the info for each column in the sharepoint file (This is the inner loop).   The files get created in the sharepoint with the attachment name, however I can't update the files with the appropriate string.   

So in the numerous set ups I've tried, I end up either with

1). a flow error

2). 6 files all with the same properties for their respective columns (instead of having their corresponding ones)

3). Just the files created without any of their properties updated.   

 

 

AKRogers
Level 8

Re: Sharepoint create and update file properties

Do you mean for each of the attachments to have the same metadata?  Because if I'm looking at this correctly, for each attachment you're setting the same information in the inner loop. 

I think what you want to do is have ONE compose action in the inner loop that looks at the [x] place in the array.  So, the first iteration would look at array[0], then array[1], and so on....

 

You may need to split your array differently, so a screenshot of the arrays from one of your Flow runs would help to straighten things out!

 

Thanks,

Ashley

 

If you found this helpful, consider giving it a thumbs up!

miketondu
Level: Powered On

Re: Sharepoint create and update file properties

Thank you very much for your reply.   

In this particular set up it's definitely got something to do with how the for loop is accessinng the array. However, in other setups I;ve tried I ended up creating the six files from the attachments six different times for each part of the array.  

Here is a screenshot of the flow run for an Email that contains 3 attachments

 

Screen Shot 2019-10-24 at 1.16.32 PM.png
Screen Shot 2019-10-24 at 10.53.14 AM.png

Screen Shot 2019-10-24 at 11.17.11 AM.png

Screen Shot 2019-10-24 at 10.51.14 AM.png

AKRogers
Level 8

Re: Sharepoint create and update file properties

Thanks, that was helpful to see! I see what you are trying to do.  What happened with this particular run, did the wrong item update or not update...?  I'm asking because in looking at the ItemId in the Outputs of the Create file action I see that value is 424.  Looking at the ID in the Outputs of the Update File Properties 2 action that value is 174.  

 

When you add in the dynamic ID in the Update File Properties action, are you using the correct ID that comes specifically from the Create File action?  You can hover over the fields to see exactly which actions/fields you are using.

 

Ashley

 

 

miketondu
Level: Powered On

Re: Sharepoint create and update file properties

I re ran the flow and am getting the same ID for both outputs:   174     

I end up getting the files created but without any of the properties updated.   I think the array I has an empty space as its last element and that might be doing soemething to it.  I haven't been able to get rid of it using the filter array option though.  

I think the main issue has something to do with how the loops are setup.

miketondu
Level: Powered On

Re: Sharepoint create and update file properties

Hey Ashley,  

 

So the main issue I have is I can't assign the right part of the array to each "create file"  and "update file action" action.

Do you have any tips on how I could access the array[x] elements in each iteration?    Maybe I shouldn't be a "for each" loop to split up the array? 

Thanks for your help 

 

 

 

Helpful resources

Announcements
thirdimage

Power Automate Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

firstImage

Incoming: New and improved badges!

We've given our badges an overhaul and also added some brand new ones!

fifthimage

Microsoft Learn

Learn how to build the business apps that you need.

sixthImage

Power Platform World Tour

Find out where you can attend!

seventhimage

Webinars & Video Gallery

Watch & learn from the Power Automate Community Video Gallery!

Top Kudoed Authors (Last 30 Days)
Users online (5,206)