Most
organizations have contracts that need to be renewed at
certain times. In the demos below Peter Kalmström, CEO and
Systems Designer of kalmstrom.com Business Solutions, shows
how to first create a SharePoint content type for a Contracts
library and then create a flow that sends a renewal reminder
to the responsible person.
"Contracts" content type
Peter creates a new site content type for contracts and
adds the following columns:
Signing date, Date and Time with Todays date as
default.
Counterparts, Lookup from a "Counterparts" list.
Type of Contract, Choice, without a default value
(Peter shows how to use Excel to get the options in
alphabetic order.)
Responsible Counsel, Person or Group
Renewal or Expiry Date, Date and Time
Counsel comment, Multiple lines of text with 'Append
Changes to Existing Text' enabled
When the content type is finished, Peter associates it with
the Contracts document library and removes the default 'Document'
content type from that library. He also makes the new columns
visible in the library and renames the 'Title' column into
"Short Description".
Reminder Flow
In this flow you must use the internal name for the "Renewal
or Expiry Date" column. If you have not used
CamelCase naming when you created the column, you can
get the code at https://www.urldecoder.org/.
Create the flow from blank and use the trigger 'Schedule
? Recurrence'.
Set the 'interval' to '1' and the 'Frequency' to
'Day'. (Set your preferred advanced options.)
Add the action 'SharePoint - Get items' for the
Contracts library.
At 'Filter Query' add the internal name for the
"Renewal or Expiry Date" column + eg + this string:
'FormatDateTime(addDays(utcNow(),7),'yyy-MM-dd')'.
Add an 'apply to each' action and use the dynamic
content 'value' as output.
Add the action 'Office 365 Outlook - Send an email'.
In the 'To' field, enter the dynamic content 'ResponsibleCounselE-mail'.
For the e-mail subject, type some general text and
add the dynamic content 'Name'.
Insert a link in the e-mail body: under advanced
option, set 'Is HTML' to Yes and add <a href="[the
dynamic content 'Link to Item']">Some general text</a>
in the body field.
Save the flow.
To test the flow, run it and make sure it has run
successfully and has no error messages.