Being ethical in a sometimes unethical world...- Branson SharePointalooza September 13th, 2014
1. Tracking Ethical Conflicts in a
Sometimes Unethical World
Thomas Duff
Cambia Health Solutions
September 12th – 13th, 2014
2. 2 | SharePointalooza – Branson, MO 2014
Who am I?
Thomas Duff, aka “Duffbert”
Technologist, blogger, writer,
speaker, SharePoint developer
20+ years with Microsoft and
IBM collaboration technologies
Email: duffbert@gmail.com
Twitter: @duffbert
Blog: sharepointduffbert.com
4. 4 | SharePointalooza – Branson, MO 2014
A Few Reminders
http://bit.ly/SPAloozaAttendee
5. 5 | SharePointalooza – Branson, MO 2014
The Bands
What better way to unwind after a
long day of working out your brain
than with some great live music at
the amazing outdoor stage at
Branson Landing! The bands will be
playing both Friday and Saturday
night from 6:30 pm to 10 pm.
6. 6 | SharePointalooza – Branson, MO 2014
Outline
Why use SharePoint to track this information?
Why are Ethics programs necessary – my story
How we got from there to here
Under the Conflict of Interest form covers
Questions?
7. 7 | SharePointalooza – Branson, MO 2014
Why use SharePoint to track this information?
No-code solution – easy to maintain
Easy to build forms – Customize Form with
InfoPath
Easy to administer – for both SharePoint
Support and the customer/site owner
Workflows can trigger notices and set
permissions
These are techniques you can use to build any
type of electronic form and workflow solutions
8. Why are Ethics programs necessary? My story…
8 | SharePointalooza – Branson, MO 2014
9. 9 | SharePointalooza – Branson, MO 2014
How we got from there to here… from Notes…
• Started Conflict of
Interest tracking
application in 2002
• Tracking for 5000+
people (employees
and contractors)
• Used Lotus Notes (our
main collaboration
tool through 2009)
• Surprisingly, many of
the benefits of this
type of form existed
both then in Notes
and now in SharePoint
10. 10 | SharePointalooza – Branson, MO 2014
How we got from there to here… to InfoPath…
• Switched to SharePoint
using InfoPath forms in
2010
• It worked, but we were
learning as we went
along
• There were… issues
• InfoPath client support
• Submissions would
disappear
• Workflows couldn’t
update information in
the XML document
• Cumbersome to work
with administratively
11. How we got from there to here… to Customized Lists
11 | SharePointalooza – Branson, MO 2014
• Made some major
changes for 2014, so
decided to go with a
SharePoint Customized
List
• Major improvements in
stability and support
• Browser support
• No reliance on
InfoPath client
• Full access to update
fields via SPD
workflows
• “It just works”
12. 12 | SharePointalooza – Branson, MO 2014
The Form…
Customizing the list item form using Customize Form With InfoPath
13. 13 | SharePointalooza – Branson, MO 2014
A series of 14 questions to flag conflicts
• Covers areas such
as:
• Connections with
providers, vendors,
other plans, or
customers
• Received
gifts/gratuities (you
and/or family) or
honorariums
• Other employment
• Family members
employed at the
company
• Other relationships
• Convictions,
disbarments, and
license revocations
14. 14 | SharePointalooza – Branson, MO 2014
Behind the scenes… for the Ethics officers
Using hidden sections,
information gathered by
the Ethics officer is stored
15. 15 | SharePointalooza – Branson, MO 2014
Behind the scenes… for the form data
To track changes that a
person makes on the form
in a specific session, we
store the current
information on Form Load
16. The employee number triggers the profile load
16 | SharePointalooza – Branson, MO 2014
When a person creates
or edits a COI, we run a
routine to update
information based on
their user profile
17. 17 | SharePointalooza – Branson, MO 2014
The profile load – how it’s done…
To accomplish the profile
load, we set up a rule that
will call the
GetUserProfileByName web
service and fill in the form
fields with the values from
that call
18. 18 | SharePointalooza – Branson, MO 2014
The profile load – how it’s done…
Start by clicking the
Manage Data
Connections under the
list of fields, and then
click Add to create a
new data connection:
19. 19 | SharePointalooza – Branson, MO 2014
The profile load – how it’s done…
The data connection
will be one that receives
data (in this case, from
the SharePoint profile
for the employee)
20. 20 | SharePointalooza – Branson, MO 2014
The profile load – how it’s done…
We’ll be using one of
the SOAP web services
that is built into
SharePoint
21. 21 | SharePointalooza – Branson, MO 2014
The profile load – how it’s done…
To find the list of web
services, enter the URL
for the WSDL file
http://<yourSite>/_vti_bin/userprofileservice.asmx?wsdl
22. 22 | SharePointalooza – Branson, MO 2014
The profile load – how it’s done…
For this particular form,
we want to use
GetUserProfileByName
as we have the account
name (the employee
number) as the key to
the profile.
23. 23 | SharePointalooza – Branson, MO 2014
The profile load – how it’s done…
On this screen, we leave
the value blank, as we
will provide the value at
the time we call the
web service with the
data connection
24. 24 | SharePointalooza – Branson, MO 2014
The profile load – how it’s done…
These are the two final screens, which
can be taken with default values. Once
that’s done, the new data connection for
the web service is finished
25. 25 | SharePointalooza – Branson, MO 2014
The profile load – how it’s done…
Once we have the data
connection in place, we
have to set the fields in the
form based on values in the
profiles
26. 26 | SharePointalooza – Branson, MO 2014
The profile load – how it’s done…
We start by adding an action to our rule – “Set a field’s value”
27. 27 | SharePointalooza – Branson, MO 2014
The profile load – how it’s done…
Choose the form field name, click on
the fx for the field value, click on
Insert Field or Group, and then use
the Advanced View to show the
GetUserProfileByName data
connection fields
28. 28 | SharePointalooza – Branson, MO 2014
The profile load – how it’s done…
Within the data connection, click on Value. To filter the data returned in Value, use
the Filter Data box to select a filter condition…
29. 29 | SharePointalooza – Branson, MO 2014
The profile load – how it’s done…
Since we’re looking for a single property
in the data connection record, we filter
on the name of the property (in this
case, Title)
30. 30 | SharePointalooza – Branson, MO 2014
The profile load – how it’s done…
Once that’s done, you now have the value of the Title field in the SharePoint
profile loaded into the Employee Title field in the form:
31. 31 | SharePointalooza – Branson, MO 2014
The profile load – how it’s done…
Side note… if you want to “code that directly instead of working through all the
panels, you can select the Edit XPath (advanced) option and do the following:
32. The questions start next… looking for “Yes” or “No”
32 | SharePointalooza – Branson, MO 2014
In the case of a
“No” answer, not
much changes
33. 33 | SharePointalooza – Branson, MO 2014
“Yes” answers trigger more questions
If a “Yes” answer is
given, then a hidden
section reveals two
required fields asking
for detail and how that
is different than last
year’s disclosure
34. 34 | SharePointalooza – Branson, MO 2014
This is done via a formatting rule…
If a “Yes” answer is given, then a hidden section reveals two required fields asking
for detail and how that is different than last year’s disclosure:
35. 35 | SharePointalooza – Branson, MO 2014
The rules for when the form loads
The Form Load rules set up the
new data for the user, as well as
storing existing data for
comparison purposes on Form
Submit
36. We grab all the existing comments on the form
36 | SharePointalooza – Branson, MO 2014
The critical part is storing the
existing comments on the form
so we can change for changes on
Form Submit
37. 37 | SharePointalooza – Branson, MO 2014
When the form submits, more rules
If there’s at least one “Yes” answer on
the form, we set a flag so that the
Ethics officer can follow up for
investigation
38. Clean up of detail fields if the answers were “No”
Housekeeping – make sure that if an
answer was set to “No”, that there are no
residual comments on the question from
prior “Yes” answer
38 | SharePointalooza – Branson, MO 2014
39. If a Yes/No answer changes, get that information
For each Yes/No answer change, track what it was changed to, as well as what the
comment was on Form Load:
39 | SharePointalooza – Branson, MO 2014
40. The Changed Entries field gathers those changes
40 | SharePointalooza – Branson, MO 2014
The Changed Entries field
is stored on the form so
the Ethics officer can
review what was changed
41. The Changed Entries field gathers those changes
This is an example of what would be loaded into the Changed Entries field for
changes I made:
41 | SharePointalooza – Branson, MO 2014
44. Workflow Impersonation – a WONDERFUL thing
Because people should only be able to see their own COI, it’s important to give each
COI unique permissions. This is done via an impersonation step in a workflow built in
SharePoint Designer:
44 | SharePointalooza – Branson, MO 2014
45. Drilling down to add and/or remove permissions
45 | SharePointalooza – Branson, MO 2014
A drill-down into removing/adding permissions:
46. 46 | SharePointalooza – Branson, MO 2014
An alternative way to set the permissions
We could have also done permissions this way, but the prior method allows us
flexibility if we ever wanted to make specific items visible to supervisors or
managers:
47. 47 | SharePointalooza – Branson, MO 2014
Emails triggered after saves…
Letting the user know there will be a review due to one “Yes” answer:
48. 48 | SharePointalooza – Branson, MO 2014
Emails triggered after saves…
Letting the user know a more thorough review is needed after preliminary review:
49. 49 | SharePointalooza – Branson, MO 2014
Emails triggered after saves…
Initial notice to let people know they need to complete the conflict statement:
50. 50 | SharePointalooza – Branson, MO 2014
Emails triggered after saves…
Initial notice to let people know everything is fine and no further action is required:
51. 51 | SharePointalooza – Branson, MO 2014
Adding icons on the workflow dropdowns…
Cool Tip… you can add workflows (and icons) to the list item dropdown menus:
These are added to the list in SharePoint Designer under Custom Actions:
52. 52 | SharePointalooza – Branson, MO 2014
Adding icons on the workflow dropdowns…
Adding a custom action
allows you to assign a
workflow to the action,
as well as an icon to
the custom action
menu entry
53. Bonus Tip! Sending ad-hoc emails on an item…
This is a nice ad-hoc email workflow you can attach to any list:
53 | SharePointalooza – Branson, MO 2014
54. Bonus Tip! Sending ad-hoc emails on an item…
It uses the Initiation Form (and parameters) as well as local variables:
54 | SharePointalooza – Branson, MO 2014
55. Bonus Tip! Sending ad-hoc emails on an item…
The Initiation Form parameters supply the To/CC/email body fields.
The local variables supply some of the standard email body text:
55 | SharePointalooza – Branson, MO 2014
56. Bonus Tip! Sending ad-hoc emails on an item…
Very simple Initiation Form design… almost the default:
56 | SharePointalooza – Branson, MO 2014
57. Bonus Tip! Sending ad-hoc emails on an item…
The Send Email action in the workflow:
57 | SharePointalooza – Branson, MO 2014
58. Bonus Tip! Sending ad-hoc emails on an item…
When the workflow is initiated, this is what the user sees:
58 | SharePointalooza – Branson, MO 2014
59. Bonus Tip! Sending ad-hoc emails on an item…
This is what the email looks like when it arrives:
59 | SharePointalooza – Branson, MO 2014
60. 60 | SharePointalooza – Branson, MO 2014
Questions?
Thank you, and enjoy the conference!
Notas do Editor
Hi, everyone… I’m Thomas Duff, also known as Duffbert in the online world. I’ve been working in the technology field for a very long time, as a developer, speaker, writer, and whatever else happened to tickle my fancy. I moved away from the mainframe and management world in the mid-90s and got involved in something called “groupware” with Lotus Notes. Collaboration software solutions have been my focus since then, and I shifted from the IBM/Lotus world into the SharePoint sphere in 2009 when our company started a migration from Notes to SharePoint and Exchange.
If you have questions or comments, you can always email me or ping me on Twitter, Facebook, LinkedIn, and any other avenue where you find the name Duffbert show up.
What we’re going to cover in this session…
Why should we use SharePoint to track this information? Well, you have to track it somehow, and this is a SharePoint conference. But SharePoint allows you to build easy-to-use forms and tracking mechanisms that can make our customers’ jobs a lot easier.
Why are Ethics programs necessary? I was part of Enron from 1998 through 2001, so the issue of conflicts of interest and ethics hit close to home for me. While this is more of a look behind the scenes of what you can do with SharePoint to build real-world applications, I frame it within the context of a conflict of interest tracking application.
How we got from there to here. I’ll cover a bit of the history of how this application evolved over the years to what we currently have in place.
Under the form covers… this is where I’ll dig in and show the moving parts of the form, how the rules work, and things that we do to ensure that only the right people see the right things.
And at the end, we’ll have time for questions.
So why use SharePoint for a site like this?
No-code solution – One of the goals we had in this particular site (and in nearly all the sites I build) was to allow a wide variety of experience levels to work with and maintain the site if need be. There’s very little in this site that couldn’t be turned over to an experienced power user to maintain if it came to that. If I had done a significant amount of custom coding using Visual Studio, I would have ended up maintaining this in our IT group for all time. I’m a big proponent of using out of the box development tools wherever possible if they work.
The list forms are easy to build and customize in InfoPath. I know that’s a bad word these days as Microsoft is trying to come up with the alternative to form design. However, InfoPath is a recognized and supported solution at this time, and there’s still not a lot of clarity as to what the replacement will be. Customize With InfoPath works well for our form design needs, so we use it.
Easy to administer – because our organization uses SharePoint every day for all kinds of things (team sites, intranet sites, custom lists, etc.), they are comfortable with the SharePoint interface. That’s one less thing we need to train them on when it comes to a new site like this. We can also set up the security such that the site administrators can see and work with all the data, while the users of the site can only see the items that belong to them.
Workflows are the key to what happens in terms of security and notification. Using impersonation workflows allows us to fine-tune the security of each COI in the system. Email notification workflows allow a single site administrator to quickly let people know the status of their COI review and whether more information is required.
Best of all, these techniques I use here are the same ones that you can use for *any* type of an electronic form and business process. While I used it to manage a conflict of interest tracking process, they could also be used to track credit applications, travel requests, or dozens of other processes used in your business every day.
Enron… ah yes… my foray into the dot.com world.
After working at my current company from 1987 through 1998, I was approached to be one of the initial Notes developers at FirstPoint Communications. It was a small fiber optic business that was part of Portland General Electric, which had recently been purchased by Enron. It was a small group (about 30 people) and all the business processes were green-field development. There were stock options should FirstPoint ever spin off (EVERYONE was going public in those days!), but it was more the chance to see if I could “run with the big dogs” in the dot.com world. Enron wasn’t sure what they wanted to do with FirstPoint, until they started to figure out that broadband could be huge, and they may be able to make a market in trading broadband as a commodity. They renamed us Enron Broadband in 1999, and things went nutso. The stock skyrocketed, Enron was a hot company, and everyone wanted in (to the tune of about 1500 people at the peak).
Like many companies, Enron had a code of conduct, mission statements, and lots of words about how everyone should be treated with respect. In our corner of the world, things pretty much worked that way. But if you went down to Houston in the main headquarters, things were a lot more nasty and cut-throat. While people on the outside complained about aspects of the company, we all thought that they just didn’t understand the way that we were changing the way business was done.
In reality, they *were* changing the way business was done, but not in the way we thought. With fraud, deception, lies, and massive conflicts of interest, the company was built on a house of cards that started to collapse in mid-2001. Our offices in Portland were closed on September 1st, 2001, and I thought I’d end up banking most of the severance as I looked to be heading back to where I work now. But then 9/11 happened, the market collapsed, Enron’s credit lines dried up, and the fraudulent loans started to unravel. Enron declared bankruptcy on December 2, 2001. Furthermore, since the economy was going into major stress mode, the job I thought I’d end up getting didn’t happen, and I was unemployed for the first time in my life.
It was a scary time, to say the least.
<Elaborate on the difference between what you say you do in terms of ethics in your organization, and what you *really* do.>
At my company, we have a *much* more robust system in place to detect and follow up on potential conflicts that might exist in the employee population.
We started the program using Lotus Notes in 2002, using features such as electronic forms, views of data, email notification, and security.
The conflict forms were kept on file for both current and former employees and contractors, so over time, we would have well over 10000 filed statements on file that would be archived and rolled forward from year to year.
This version of the application, with minor question and wording changes, was used until 2009 when the decision was made to move from Notes to “other platforms”. In this particular case, SharePoint’s ability to create electronic forms with workflows made it an excellent target platform for migration.
Side note… I know that many people hold Notes in low esteem, but it was basically SharePoint before there was SharePoint. What made the transfer to a SharePoint environment relatively easy (in terms of business functionality) is that there was a one-to-one function match for many of the features we used.
In 2010, we rolled out our first version of the new CO I site using InfoPath forms running in our new SharePoint 2007 environment.
Why InfoPath client forms? Well, in SharePoint 2007 it was a lot harder to customize the standard form layout of a custom list. The InfoPath Designer environment was very familiar to me as a former Notes developer, and having the form launch in the InfoPath client meant that we had a very rich set of client features we could use (repeating tables and fields come to mind quickly). Since we were developing for a Windows environment, everyone had InfoPath as part of their normal software set, so that was fine. Basically, we were developing a Notes application that didn’t need Notes.
In hindsight, however… We struggled with a number of issues. The InfoPath client could be stubborn at times. We had URL configurations that would launch the InfoPath form in InfoPath, but sometimes that got messed up on peoples’ computers, and it would try (without success) to open in the browser. We also started to get people using Macs in the office, and InfoPath wasn’t an option for them.
On occasion, people would submit their COI form via InfoPath, it would say it was submitted, everything looked completely correct, and then… it just wasn’t there in the SharePoint document library. We tried everything to troubleshoot that, and we never did figure out a consistent set of reasons or situations. We occasionally would just have to create the base COI for them, and then let them edit an existing one instead of creating one from scratch.
Workflows were also problematic. The workflows are designed to interact with and update list columns, but InfoPath forms are actually XML documents. It can display various columns from the InfoPath form, but you can’t update them within the document. Therefore, you had to be more creative in terms of tracking status fields and such. You’d often end up with some of your columns only being available for display from the XML form while others were actual columns in the document library items.
Administratively, it was also more cumbersome. Everything (including attachments) were stored in a large XML document, and there was less transparency into what was in there and what you could do to get data out. Moving items to different libraries (like for archiving) could often involve dragging and dropping files into other document libraries, InfoPath forms had to be published to more than one library, etc.
There was a lot of power in the richness of the InfoPath client, but with that came a lot of complexity.
In 2014, we had to make some major question and wording changes, so I took this opportunity to do what I should have done in the first place… make it a custom list in SharePoint 2010 and use the Customize in InfoPath feature to make the form useful to everyone. This had a lot of benefits:
Now that the form runs in the browser, we are able to accommodate both PC and Macs in our environment. In addition, we can use our mobile solution that people use to VPN into our environment in order to let them view their COI information. In the InfoPath client solution, none of that was possible.
Dropping reliance on the InfoPath client is also a good thing, as most of the InfoPath client use in our organization is (to the best of my knowledge) tied to SharePoint. If we can eliminate that as an option for our SharePoint site development, that’s one less thing to support.
Since all of our form fields are now part of the customized list (and not locked away in an InfoPath XML document), I can update and modify content in workflows and data sheet views. This means that updating forms is much easier for status tracking, and it’s also a LOT easier to do one-off workflows to fix data issues.
It Just Works… in the InfoPath client version of the site, I was talking with the owner of the COI process at least once a week to correct data issues, figure out why someone couldn’t launch their COI, trying to figure out where their COI went, determining why InfoPath didn’t work for someone, etc. Now with browser-based access in a custom list, everything just works. The only time I talk with the site owner is if they want to change the wording in a form. If I wanted, I could even turn that over to them. But at least at this point in time, the demand on my time is so minimal that I choose to keep that level of control in our area.
So let’s get into what the form looks like, how we customize it, and what we do under the covers to make it all work…
The core of the COI form is a series of Yes/No questions that are designed to elicit information that might indicate a potential conflict of interest between the employee and the organization. These cover standard things such as whether the employee has a connection with health care providers, vendors we do business with, other insurance plans, or customers of our services. If any of these exist, a Yes answer will open up additional fields so that the employee can elaborate on the potential conflict.
In addition to connections, we track whether gifts or gratuities have been given or received in various situations (and whether family members were involved), or whether honorariums were received for speaking or appearing at conferences and seminars. Do you have other employment? If so, please note it. Are other family members working at the company? Let us know. Are there other relationships that should be noted? You can note them here. Also, any issues with convictions, disbarments, or revocation of licenses should be noted.
It’s important to mention here that answering Yes to any of these questions does NOT mean that you are unable to work for the company. It just means that you’ve noted that certain situations exist, and that you want to make sure they’re on the record in case any questions arise down the road. It protects both you and the company from liability later on.
<share story of speaking at Lotusphere, getting the conference fee waived, but not knowing that it should have been disclosed here. Also share about my book writing for IBM technology when we were customers of them for various software>
On top of the questions that we ask the person filling out there form, there’s a hidden section on the form that allows the COI administrators to record their research work for each specific question. It also stores information on whether certain program waivers are in place, as well as an indicator to show if there is at least one question that’s answered Yes. This is a trigger to send out certain emails or show views of COIs that need investigation.
We also have a hidden section for processing fields that allow us to flag certain conditions. For instance, we need to be able to note whether someone changed a comment or removed a comment by switching an answer from yes to no. To do that, we save the comments when the form is loaded. We never used to store those fields in the InfoPath version of the form, so troubleshooting could get dicey at times. In the new versions with a customized list, we decided to just save the fields and display them in a form section that would be displayable to the site admins and the developers. Now if we have any questions about whether a person changed data, we can go back and see exactly what the before and after version of the comment was, and determine if the site is working as expected.
One of the techniques we use in this form is to pull the employee’s personal information that’s stored in the SharePoint profile. Since we synchronize that information nightly from Active Directory, this allows us to make sure the hire date is always correct, the title is the official one they have on record, and their department is consistent across all the people that work there.
Since we know the person’s employee number (userName() function) when they open the form, we can use that number (which is the same as their account ID) to hit the profile via a web service. That information is then populated automatically without them having to make any decisions. In fact, we don’t even let them edit those fields. If something’s incorrect, they would have to fix it in whatever up-stream system feeds Active Directory.
The call to the profile is done via the GetUserProfileByName web service that comes standard in SharePoint, and we set that up in a rule. All we need to do is pass the account number that the web service needs to find the profile, and then make the call.
To start, we go to the bottom of the list of fields and click on the Manage Data Connections link to set up the connection we’ll use. In the list here on the right, I already have my connection set up, but let me show you how that’s done.
To add a new data connection, start by clicking Add.
We will be creating a data connection to receive data stored somewhere on the system. I already know where my data will be coming from (the SharePoint Profile via a web service), so I can leave the search option blank.
Now I can select the source. I have a number of options, such as SOAP or REST web services, other SharePoint lists and libraries, relational data in SQL Server, or an XML document stored somewhere. In this case, I’m going to use one of the pre-defined SOAP web services, so I’ll choose that one.
SharePoint wants your WSDL (Web Services Description Language) file so it knows what the SOAP web service interface will look like. That will tell it what parameters can be passed to the service, as well as what information will be returned. The “_vti_bin/userprofileservice.asmx?wsdl” part of the URL is standard for the user profile web services, and all you need to do is provide the URL of your sharepoint site, like www.contoso.com.
What you get back is a list of all the available web services you can select from. Since I’m interested in retrieving data from the user profile, I select the GetUserProfileByName web service. I could do different connections if I wanted to add people to a permissions group, update user profile information, etc.
The wizard now wants to know what information will be provided based on the WSDL information it retrieved earlier. For this particular web service, it needs the account name of the person who the profile belongs to. In our particular scenario, that information is the person’s employee number. I could put a pre-defined value in here, but that wouldn’t do me any good as it’ll change on each form. Instead, I’ll supply that when I call the web service in the data connection back in my form rule.
The last two wizard screens are ones that you can just take the defaults on. Since I won’t be working offline with this form, I don’t want to store a copy of this data within the form itself. I’ll be making my connections at the time they fill out the form. Also, I do not want this call to take place automatically when I open the form, because the employee number field for the Account Name will be blank on new COIs. There’d be nothing to call. I’m going to be retrieving that data in my rule.
Click finish, and you have now established a data connection from your form to the user profile web service.
The series of rules here uses the connection we just built to get the profile information. The AccountName (which is what the web service wanted to find the profile) is set to the Employee ID field, and then the Query action is used.
When the Query action finishes, you should have a link to the profile. Then it’s a matter of setting the fields on your form to be equal to the various profile fields. In this case, I’m going to get the Last Name, First Name, Hire Date, Title, Department, and Phone Number.
Side note… You’ll see two entries there for hire date. The reason is that the format of the Hire Date field on the form is YYYY-MM-DD, but we store it in the profile as YYYYMMDD with no dashes. So the second Set Field Value line takes the raw date without dashes and creates a new string by concatenating dashes with the various date parts. By doing that, the date is valid when it shows up on the form, and no edit errors occur.
To get a specific field out of the returned profile query, you have to take a few steps to filter out the field value that you want. We’ll take the Title field as an example and walk through it…
First, I’ll add an action to my rule. I have four types of actions, but I’m only interested in setting a field value (the Title) field.
In the action dialog panel, I’ll set the field on the form that I want to update (Employee Title is what I’ve called it in my list). For the Value, I click the function button. That brings up the Insert Formula panel, where I click the Insert Field or Group button. Finally… that brings up the Select a Field or Group panel. I need to click Show Advanced View to get the ability to see all the fields in all the data connections like I have here. I work my way down into the property data area, and I select Value as I want the value of a particular field.
But I also need to tell the system *what* field I want the value of, so I click the Filter Data button.
That brings up yet another panel for Filter Data, where I click Add to add my data filter.
Yes… another panel for specifying the filter conditions… I want to specify the name of the field in my query data, so I choose the Select a field or group option.
Guess what… another panel… we’re in six deep now.
I select Name in my property data group, as that’s where the name of the field is stored. I click OK, and it takes me back to the Filter Conditions panel. The Name field is selected, and I want to get the field that has a name equal to Title in the profile.
Side note: The name of the field is case-sensitive. So if the person’s division information is stored in the profile in a field called Division, you have to use “Division” to get it. “division” won’t match anything, but it won’t error out, either… you just won’t get any data back.
Now that we have our filter set, we start clicking OK to back our way out and get back to the original action we set in the rule.
When we get back to the formula panel, we should see something like what’s listed above.
Basically, what we did was say that in the Employee Title field on the list and form, I want to look in the profile information for that employee ID, and I want to return the value of the field in the profile that we call Title.
Since I’m targeting the Information Worker (“power user”) in this session, this particular slide would rarely come into play. But if you hate working through the panels (they are tedious) and you want to “code” the link to the field, feel free to select the Edit XPath option and code it manually…
Granted, if you did the first field and then copy and pasted this formula, you could do successive ones by just changing the field name at the very end. But just understand that XPath is not very(!) intuitive, and going through the panels eliminates a lot of errors.
After the profile information part of the form, the questions start appearing. We format the question based on how the business wanted to word the information, and then we have a Choice field using radio buttons with values of Yes and No.
Side note: There are Yes/No field options in SharePoint, but I didn’t want to use those in this case. The Yes/No field is a single checkbox that’s True if selected and False if not. Since the business wanted to see an actual Yes and No option that forced one of the two options to be selected, I used Choice with radio buttons.
If the person selects Yes for an answer, we reveal two additional fields for the question. These are normal multi-line text fields that ask for additional information about the Yes answer to the potential conflict.
Behind the scenes… To have those two fields appear for Yes answers, we put both fields into a Section control on the form. Then we add a Formatting rule that’s attached to that section.
For the rule, we look to see if the Yes/No question is not equal to Yes. So if that field is blank or No, we hide the section. If the answer turns to Yes, then that rule is no longer in effect and the section appears.
This same concept appears for each of the questions… A No answer to all the questions means the form is relatively streamlined. The description and detail information only shows up on the form when necessary.
One of the events you can control via rules is on Form Load. We use that technique here to initialize certain fields, check for certain conditions for later processing, and store information as to who is working with the form.
One of the critical things we have to do is make sure we can track before/after changes on any of the comments. We could have the business do that with the SharePoint versioning feature, but they’d have to do a lot of checking for anything that might have changed. We wanted to give them something that was a bit more intuitive and obvious, as well as being completely contained within a single document.
For the Load Comments For Potential Audit Trail Entry rule, we set up a number of actions that store the starting value of the question comments. In most cases, that’s just a single description field. But in a couple of the questions, we concatenate a number of fields together that make up the entire comment. For instance, the gift received question has detail about who it was from, what it was, when it occurred, and how much it was worth. By concatenating all those together, we can show it to the user if necessary.
The other important event where we can trigger rules is when the form is submitted. So here we do a number of things.
We set dates for last employee changed or reviewed based on whether any of the Yes/No answers were changed.
We check each of the questions to see if at least one of them equaled yes. If there was at least one yes, we set the AtLeastOneConflict indicator so the business knows there’s something they need to look at.
We also use this for data clean-up. For instance, someone may have changed a question from Yes to No. If they did that, the description fields would disappear on the form (as they should). But the data would still be stored out there. To keep things cleaned up, we make sure the description fields are blanked out if a question is answered with No. It makes it a lot easier to keep the data clean as we go.
So when I mentioned being able to show the user the comment changes… We do this by adding a rule to each of the Yes/No question fields.
The rule is triggered if there’s a change from No to Yes or Yes to No. If that happens, we start building a field that shows all the comment changes. For each change, it shows:
The current date/time
What the question was changed to (yes or no)
What the prior value of the comment field was
The “audit trail” continues to build with each question change…
… and it gets stored in the area where the Ethics officer can review any of the changes made by the employee.
Here’s an example of what my audit trail looked like when I changed my COI this year. I updated the text on question 2 about any potential ties to a vendor. Giving the reviewer this information in one place makes it really easy for them to quickly determine whether additional information is needed.
So we used InfoPath to customize the form and add a lot of processing logic via Rules. We could leave the form and the site as is and it would give the business a lot of values. But there are some additional things we can do with the site and form via SharePoint Designer and workflows.
The first thing we use workflows for is setting the security on each individual COI.
The requirement for COIs is that everyone needs to be able to create a COI and edit their own COI, but they shouldn’t be able to see any other COI in the system. Meanwhile, the site administrators and Ethics officers need to see everything. We can do that via an impersonation step in a workflow. If you haven’t ever used impersonation in workflows, this is a wonderful thing. When Sandra first figured this out and showed me a number of years back, I was speechless. When she’s showed this to others in sessions like this, people have started to tear up. It’s really cool.
So we set this workflow up to run whenever a new item is created. It can also be triggered manually if needed, but normally the “when created” run will handle it just fine.
In the workflow, you set up a new step as an Impersonation Step. When this workflow runs, it runs under the permission of the person who triggered it. In our case, that is the site administrator as she puts the core COIs out there for each new employee.
What we’re going to do here is break inheritance on the specific COI and reset the permissions to be unique. So we check to make sure the employee number belongs to a valid SharePoint user.
If the person has a valid account, we remove the Contribute Edit Only permission set from the COI. That means the default level of access is removed and no regular employee could see the COI. We then add back in the Contribute Edit Only permission just for the specific employee. They can now see their own COI again. We also add in (or ensure that it’s added) the Owners group so that the reviewers can see everything.
If for some reason the employee number is not a valid SharePoint account (it shouldn’t happen, but you never know), we still remove the Contribute Edit Only permission group from the COI so no one can see it. We then make sure the reviewer group is added in so they can see it and do whatever is necessary to correct things.
Here’s what the drill-down looks like when you add or remove permissions. When I selected the Remove action, I was able to specify what permission on the COI I wanted to review. Just to show what it looks like (since I already had it out there), I clicked the Modify button to show what I did with the Conflict Of Interest Members group. I selected the permission I wanted to remove.
There is a second way you can set permissions to allow people to only see the items that belong to them. If you go into List Settings for the list and click on the Advanced options, you can set item-level permissions from there.
This gives you the ability to specify who can see items in the list, as well as who can edit items on the list. If people created their own COIs, we could get by with setting the Read Access to allow people to only see their own items. We could then set the Create and Edit Access to only let people change their own items.
Unfortunately, the site admin sets the COI up for people, so we’d have problems with individuals not being the document creator. In addition, using this feature wouldn’t allow us any flexibility down the road if we wanted to allow additional individuals the ability to see specific COIs. Using the workflow gives us more flexibility both now and for future requests.
We also set up workflows for various emails that need to be sent out. The site administrator had been creating views to see if people needed to be notified in various conditions. Once we found that out, we were able to create workflows for her that send out the emails either automatically or on demand.
In the workflow, I select the action to send an email. When that’s selected, this screen comes up so I can define how the email should look and who it should go to. The To field is sent to the employee ID of the person who owns the COI. The CC is a specific email address that belongs to the Ethics area. The subject is hardcoded. The body of the email is simply standard text, and we’re not calling in any fields from the COI. We could have given them a specific link to their COI in the body of the email using the Add or Change Lookup button in the lower left corner. But since they can only see their own COI due to permissions, we can send them to the site home page where there’s a list view web part that shows the list content. The only thing they see is their own, and the site owner ensures they also see any important information that’s been posted on the home page.
This is the email we send out if someone had a “Yes” answer.
This email is used for COIs that have been reviewed, but based on the supplied information, a more detailed review will be necessary.
This is the email that’s sent out when the site administrator creates a COI for a new person. It lets them know they need to go out and complete the COI, and it also gives them links to appropriate information related to the ethics program.
If someone completed their COI and nothing of note was indicated, then they get this email to acknowledge the COI has been received and nothing more is required.
This was a cool tip I ran across when it came to setting up workflows for people to trigger manually. Normally, I would show people how to click on the dropdown for the list item, go into the Workflow menu option, and then select the workflow from there.
But then I found out that I could actually put a custom action on the dropdown menu using SharePoint Designer. The custom action can trigger a workflow, AND you can add an icon next to the action for a bit of polish and visual differentiation.
To do this, go into the list in SharePoint Designer and go down into the Custom Actions session. Click New to create a custom action…
Give your custom action a name and description, and then specify what you’d like to have happen. In this case, we’re going to initiate a workflow. The dropdown arrow will show all the workflows in the site, so select the one that is appropriate for this entry.
You could stop here, and everything would be done. But if you scroll down on that panel, you’ll see advanced options (I missed this for a LONG time). Under the advanced options, you can select a 16x16 image you have stored on your site, and that will be the list item icon in the menu. You can also set the sequence of the various menu items.
Using this is a great idea for all your manually triggered workflows, as it saves the user an additional click and it’s much more intuitive in terms of the workflow interaction.
One more bonus tip on workflows…
This is a workflow I’ve used in a lot of various lists and sites. It’s a manually triggered workflow that allows the user to send an ad-hoc email to someone that’s linked to a specific list item.
So in the COI site, I might have a need to send an email to someone about a COI, but it’s not one of the standard emails we have in place. I could go get the link to the COI, go into Outlook, create a new email, paste in the link, and then compose whatever message I want to send.
Or, I could use a workflow like this to make it very easy to send an email related to that COI.
This workflow uses Initiation Form Parameters and Local variables to format the email.
Initiation Form parameters are variables that the user will be prompted to enter before the workflow executes. When the email runs, it will set a local variable to the URL of the list item, another local variable to the current user (the person who is sending the email), and a local variable to put some standard verbiage in the email aside from the text that the person sends.
These are the two sets of variables we use. The Initiation Form parameters will have the SendTo, CopyTo, and EmailBody parameters that need to be entered by the user (more on that in the next slide), and the three local variables are as we talked about in the last slide.
In the lower-right corner of the workflow home page, there was a section for Forms. This form is the Initiation Form, and by default it shows the field name on the left side and the field on the right side. Using the InfoPath designer like we used in the main form, I can update the form to be a bit more instructive. But ultimately, it’s still only showing the three fields we defined in the Initiation Form parameter section.
For the Send Email action, this his how the email configuration looks… The email goes to the SendTo person, the CC to the CopyTo person, and the subject is whatever makes sense for the site. The DoNotReply statement goes at the top in red so it’s noticed. The Initiation Form parameter for the email body goes into the middle, and a link to that specific list item goes at the end.
Here’s what it looks like when we launch the workflow. I get the Initiation Form, address it to myself, and put some text into the email body. When done, I click Send.
And here’s what the email looks like when it comes to the recipient. You see that red text that also includes the information about who sent the email.
I find this is a requested feature in most of the sites I build for people, as they always seem to want to send an email to someone in reference to some list item.