The
SharePoint Search displays title hits on top, so for the
search to work well it is important that title columns in
lists and libraries are filled out with terms that give
relevant information.
However, for many organizations it is a problem that library
titles are not accurate, which leads to few or inaccurate
search results. This issue can have several reasons:
It is not mandatory to fill out the title field
in SharePoint document libraries.
The title field does not have the same importance
in a file system as it has in SharePoint, so files that
are imported into SharePoint libraries will often lack
titles or have irrelevant titles.
When you create a new library, the title field is
not visible by default.
In the demo below Peter Kalmström, CEO and Systems Designer
of kalmstrom.com Business Solutions, shows how to create
a flow that sets the title to the same as the name of the
file. The name is hopefully relevant, so this flow solves
the problems with non-existing as well as irrelevant titles.
Note that files created inside a SharePoint library get
a default name: Document, Book or Presentation, depending
on file type. If the creators do not change the default
names, the library will contain many documents with different
content but the same, non-descriptive names. Then this flow
will not help, as the titles will be as useless as the names.
The flow in the demo works well when files are uploaded to the library.
When they are created in SharePoint, we should give the author time to give the file a proper name, by adding a Delay action after the trigger. This is described in detail in the book,
SharePoint Flows from Scratch.
Steps to create a flow that sets title = name
Create an automated flow from blank.
Select the trigger 'SharePoint, When an item is
created or modified'.
Select the SharePoint site URL, or enter the URL
as a custom value.
Enter the SharePoint library name as a custom value.
Click on 'New step' and then 'New action'.
Select the SharePoint action 'Get file properties'.
Select the site and library again and the dynamic
content ID.
Click on 'New step' and then 'New action' and select
the SharePoint action 'Update item'.
Select the site and library again and the dynamic
content ID. At 'Title', add the dynamic content 'Name'.
Save the flow.
Test the Flow by performing the trigger action:
Create a new file in the document library and make sure
that it gets a title that is the same as the name.
To update the titles of the existing files, give them all
the same dummy title in edit mode. Now they are modified,
and the flow will run and change the dummy titles to the
same as the file names.