In this small tip, I want to continue theme related to HelpDesk creation in Office365 or OnPremises. I want to describe small addition that will help to change Created By field to correct user name as on the figure below:
The basic idea is very simple. We need to create a Contacts list, which consists from the following fields:
- Title (Text)
- Email (Text)
- User (SPUser)
The Contact list will be used to lookup SPUser account by email.
In main workflow, I have added another stage that will lookup user by Email and set Author field.
There are two important moments:
The first is setting SPUserID variable. As you can see at the screenshot below, I query ‘Contacts’ list by Email field and select ‘User Id’ value.
The second is updating ‘Author’ field via Update List Item at Any Site workflow action. For this we pass filled dictionary as input parameter:
That is all. Now we need to fill the ‘Contacts’ list and we will get correct ‘Author’ field.
Please feel free to comment