Stack Exchange network consists of 183 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.
@johnG I would suggest to open the documents in client applications as opening in web browser restricts lot of the functions like macros. This is a future proof solution
@C.Meier. I have updated my answer. The State_Status_Lookup field is not required. The workflow on State list can find the related item in Building list using State_Title_Lookup field. Same for Building and Switch lists.
@user69859 I have updated the answer with the code sample. You can extend the sample for more than 2 words in full name. The user full name is most likely set as "last, first" in your active directory or SharePoint user profile.
Sorry @JumpeiYamauchi, GetItemsWithUniquePermissions is available only on on-premises SharePoint server object model . Microsoft must be using server object model to display the message "Some items of this list may have unique permissions which are not controlled from this page."