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

Add link to item (from Picture Library) in a column of a Document Library when information in People column matches

Hi there!

 

I'm attempting to make a Flow that will auto-populate an employee's headshot when their name is selected in the People column of a resume file. I'm running into trouble and I'm not sure if it's even possible.

 

I have a Picture Library that stores all staff headshots. This library has a People column that needs to be filled out with each staff member's name.

 

I also have a Document Library with a People column (filled out with each staff member's name) and a Headshot column (where I am manually adding a link to each staff member's corresponding headshot from the Picture Library).

 

I'd like to make an Automated Flow that looks at both Libraries and, if the Employee (People column) field's information matches, will input the link to the headshot in the resume's "Headshot" column. However, whenever I add an "Update File" or "Update File Properties" it doesn't list each file's columns. I expected it would be similar to how I can update each column in "Update Item" for a list item? Any advice is greatly appreciated!

10 REPLIES 10
zaphod88
Responsive Resident
Responsive Resident

Have you tried just using the Update item action instead? You have to fill in the library name as user-defined as it is not showing in the list, but should be working.

I can get that action to recognize the Library, I believe, but I only have the option to update the following columns and a required ID. The column I need to update doesn't appear, and I'm not clear why that would be.

 

  • *Id (Unique identifier of item to be updated)
  • Title
  • Employee Claims
  • Description
zaphod88
Responsive Resident
Responsive Resident

What's the type of your "Headshot" column?

BrandonSSE
Frequent Visitor

It's a " Hyperlink or Picture" column, and I've been manually inputting the link to the corresponding headshot located in a "Headshots" Picture Library. It's been displaying the thumbnail of the headshot. If there's another column that might achieve the same result, I'd be open to that.

zaphod88
Responsive Resident
Responsive Resident

I found a way to update the column. Unfortunately, built-in standard connectors won't work. You need to use the "Send HTTP request to Sharepoint" action instead:

zaphod88_0-1621011818147.png

 

Here is an explanation and copy-paste texts for that:
https://natechamberlain.com/2019/12/21/update-a-hyperlink-or-picture-column-in-sharepoint-using-micr...

To find your ListItem type, use this link:
https://nishantrana.me/2013/10/03/a-type-named-sp-data-listitem-could-not-be-resolved-by-the-model-w...

 

 




@zaphod88, thank you so much for your help (and I apologize for my late response) but I'm afraid I'm either misunderstanding or I'm not explaining what I'm looking for correctly.

 

Context of what I wish to happen:

  • I have a SharePoint Site titled "Resumes + Headshots" with the Site URL being "https://MYSITE.sharepoint.com/sites/ResumesHeadshots"
  • This site has a Document Library titled "Resumes" with PDF/DOC files for each employee. This library has two columns:
    1. "Headshots" which should contain a link and…
    2. "Employee Name" which the uploader fills out with the employee's name (from the resume)
  • This site also has a Picture Library titled "Headshots" with image files of each employee with one column:
    1. "Employee Name" which the uploader fills out with the employee's name (the employee in the image)

 

I'm attempting to automate this so that:

  • PowerAutomate looks at both the Document Library and the Picture Library, specifically the "Employee Name" columns
  • If there is a match for an Employee Name from each Library:
    1. it grabs the link of the file from the "Headshots" Picture Library and
    2. inputs it into the "Headshot" column of the "Resumes" Document Library.

 

I have no idea if this is possible. Your flow suggestion confuses me, and if it should work with the above, I'm sure I'm missing some piece:

Screen Shot 2021-05-18 at 11.44.06 AM.png

If you have any suggestions on where I might be going wrong, I'd be so appreciative. You've been so helpful, thank you!

zaphod88
Responsive Resident
Responsive Resident

So what you need between your trigger and the Send HTTP request action is this:

zaphod88_1-1621361310537.png

 

 

After the trigger, do an Get items getting the headshots. This returns an array containing all items. You can either filter the Get items action by OData filter (which can be a bit tricky IMHO) or use Filter array action. "Value" is @body('Get_items:_Headshots')?['body/value'] here. "Erstellt von" (= Created) is just an example for a people picker column, so enter the matching employees column from Headshots (Get items) and Resumes (Trigger) here. 

You are getting a filtered array which (if the employees are unique in both lists) should have only one item, so do not worry about the Apply to each. This one Headshot list item can be updated by the Send HTTP request action. So you have to put items(@item()?['ID']) at the end of the Uri which chooses the ID property from the filtered array ( = the ID where Headshot employee column is matching the triggering items employee column).

BrandonSSE
Frequent Visitor

Okay, everything is working except for the Apply to each/last step. I get this error:

 

ExpressionEvaluationFailed. The execution of template action 'Apply_to_each' failed: the result of the evaluation of 'foreach' expression '@@@{body('Filter_array')}('Get_items:_Headshots')?['@{body('Filter_array')}/@{outputs('Get_items')?['body/value']}']' is of type 'String'. The result must be a valid array.

 

And this is how I have this step filled out:

Screen Shot 2021-05-19 at 11.36.20 AM.png

I'm not sure if I'm filling out text vs dynamic content correctly, or if some of these should be "Headshots" vs "Resumes. Since this is "POST" method I'm assuming it should all be Resumes info?

zaphod88
Responsive Resident
Responsive Resident

Basically, Site Address and Url are the same like an "Update item" action - you are telling the flow which list and item to choose here. Body chooses the column ('Hyperlink') to update, but you need to enter it as plain text, not a dynamic value. See my example above - 'test45' is the name of the column. Description and Url in body are the data you want to fill in. That means:

The array to be filtered is just "Body" from "Filter array". And watch up the Uri input syntax, it has to be:
_api/web/lists/GetByTitle('Headshots')/items(@item()?['ID']) where the bold part has to be filled in by expression editor completely. It seems like Flow has not interpreted it correctly as an expression. You want to update the Headshots list, so you have to choose it in Uri input.

The 'http://www.google.com' in body should be the url of your changed item from the trigger. 'Hyperlink' has to be replaced with the name of the column you want to be updated.

 

 

Now it's giving me this error?

The type SP.ListItemEntityCollection does not support HTTP PATCH method.

Helpful resources

Announcements
Process Advisor

Introducing Process Advisor

Check out the new Process Advisor community forum board!

MPA User Group

Welcome to the User Group Public Preview

Check out new user group experience and if you are a leader please create your group

V3_PVA CAmpaign Carousel.png

Community Challenge - Giveaways!

Participate in the Power Virtual Agents Community Challenge

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.

Top Kudoed Authors
Users online (3,317)