Infopath - Create a drop-down List from Active Directory "Department" field - infopath2010

Is it possible to create a Drop-down list in InfoPath which connects to Active Directory and fills the list with UNIQUE Department Values only (no repeating ones)
I need this for an InfoPath so when a user entering the data can pick one of the departments listed in the drop-down. Any help would be appreciated.
I've had a look at the people picker control, which works great for User names, but the department field is a separate field and has nothing to do with the user I pick, so I simply need a control which is populated by the unique Department codes in AD.
Any help would be appreciated.

You should really contact your administrator for this sort of information. You do not want a form to query every AD user to pull their department and get the unique values just to populate a drop down list. It is very possible to obtain the list of unique directories, however you should work with your administrator to populate this data to an XML web page or other similar solution and then connect your form to THAT data source through the form. The point is you are missing a step of obtaining the queried data.
With that said you can obtain the department of the user by querying the get user profile service to obtain the department name, elinating the need to even create a populated drop down list. See this article.

Related

How can I use PowerBI's Row Level Security to implement an employee filter on a website?

I have to embed a PowerBI scorecard visual on a website. I've set up the scorecard in PowerBI Desktop, and it looks fine; the slicer for the scorecard filters the employee name.
I'd like for the employee that visits the company website to see only their data in the scorecard- in other words, their presence on the website would automatically filter the scorecard to reveal their statistics only. Fortunately, they have to login to the company's website by providing their Windows credentials.
I'm not sure how to go about doing this. I understand that I have to use the "Security" portion of the "Modeling" tab, and I've (successfully) created an explicit role for one viewer by using the following code:
'Table1'[Employee Name] = "John Smith"
Of course, this only reflects John Smith's statistics when I click "View as Roles." I don't think it's practical to explicitly write a DAX code snippet for every single employee, since my company has 3000+ employees.
Can anyone share any instructions, or lead me to some?
Thank you in advance.
I had to deal with a similar issue, though we view our dashboards within the Power BI service, so that is the authentication I am familiar with. The basis for this form of dynamic row level security is that the expression written is evaluated for each row in the indicated table to either True or False.
If your user has signed in to the you will be able to determine the identity using USERPRINCIPALNAME(). This is the email address they use to sign into the service.
Since you are displaying data specific to that user, it is possible you already have their email in your data. If that is the case, and it is simply another field in your table your validation line would look something like:
'Table1'[Email] = USERPRINCIPALNAME()
The left side of the expression refers to the row you are referencing, while the right will supply the name of the authenticated user. If you don't have that available in your existing data, you could use a DAX expression to lookup the Employee name from a list of emails and their associated names.
In this case, you only have one role which everyone needs to be assigned to, and the logic above will determine which rows they can see.
This is a simple example in which each employee can only see their own data. The model can be extended by creating 'security tables' with users and their associated records, and then utilizing the CONTAINS() function to check authorization, but it sounds like you have a 1-to-1 relationship with what individuals should be able to see.

Sharepoint 2010 - list item permission according to value in column

I have a sharepoint list "Notes" with columns [Title] and [Department].
I fetch values for column [Department] from another list called "Departments" (columns [Id] and [Name].
I want this:
Everytime I add new record in "Notes", I want to set permission for this record according to permission set on the value in column Department.
So, basicaly, I SOMEHOW need to first set permissions, which users or groups has rigths for each department in list "Departments". After that, I need to inherit this permission in "Notes" list from the value of [Department].
For example:
Departments list would look like this
Billing (some permission for users or groups)
Operations (some permission for users or groups)
Sales (some permission for users or groups)
I want to add new record in "Notes" like "Hello, new item" and I chose department "Billing".
Now, I want that only users/groups which has rigths to see Billing records can see this record. No one else.
And so on... as soon as I add new record with [Department] Operations, I want only users/groups which have rigths to see Operations record to see only these records.
Is there any solution for me? I think it should has something to do with sharepoint designer workflow "Replace permission" but I never figured it out how to set as described above.
Thanks,
Jan
As you mentioned, the "Replace List Item Permissions" Action is the only way to achieve this without creating a custom event receiver. Here is a blog post about it: http://spcycle.blogspot.com.tr/2012/01/how-to-create-workflow-to-change-item.html.
Having said that, I don't think securing sensitive information at item level in a shared list by using workflows is a good idea. What if the workflow stops working someday for some reason? Not a rare case when you upgrade your SP deployment to the next version... People would keep using that list by relying on the assumption that their information is secured and I can imagine that that can create a lot of trouble for some. Besides if the number of items in that list is going to be "high" you will have performance issues and potentially hit the soft limits of SharePoint.
I would create a separate list for each department to store their notes or create a folder in the Note List for each department, lock it down to the corresponding department and ask that department's users to put their notes into their department's folder.

SharePoint 365 - Get user name based on user id returned from api to separate list

I'm getting a user id number back when I API a person field on a list. I'm hoping someone knows of an easy way to get the user name value for a particular user id.
My goal is to populate a person field in my current list form with a value from a person field in another list based on certain conditions, but unfortunately I'm not sure how to utilize the user id toward this end.
I think I figured it out. Instead of using a people picker I used an ASP textbox and databind to update to the user id. Appears to work.

How to populate a site column from a list to another list?

I have defined a couple of lists for capturing registration details of the user. There is a list for holding personal details of the user and there is another list which holds professional details of the user.
The two lists are used over two different pages in which name and ID both are required.
How do I get the name and ID populated automatically into the professional list from personal list so as the user doesn't have to fill the similar information twice?
Is it possible without doing any coding stuff?
This little control may help you
http://cascddlistwithfilter.codeplex.com/
Basically you would link the first Cascading drop down control to your user details list and the field name. The second drop down would then filter the users ID so the user can select that.
I have used this before and it can be a pain in the backside to configure but when it's there it is so very powerful and useful.
It's not fully automated but i'm unsure how you would get any closer with a bespoke event receiver.
Create the custom form there, you have keep some text box with the refresh button, so when ever you fill the user id and press the refresh button. You need to right small logic to bring the user from the the source list.
Or you can use the personal details id as look up column in the prop list so you will get the id and select the id and do refresh. Anyway you have right the logic in your custom form code.

SharePoint 2007 List column name with different display name

I'm very new to using SharePoint. I have created a custom list that I use as a linked table in Access. As the access database pre-existed, i need the column names in my SharePoint List to match those that are in the Access Database, otherwise all my Reports & Queries etc will not work.
Is there a way to have a separate display name for the columns in my SharePoint List.
For example, the column names are currently like "Innov_Desc", which isn't User friendly. When the users are adding "New Items", I need to display "Description" for example.
Any help will be appreciated.
Thanks
Derek
If you are trying to do this change from the the user interface (from settings), I'm afraid it's impossible. You will have to do this change in the code.
Please check the links below to get general idea of what is involve when naming columns:
Finding the internal name and display name for a list column
SharePoint Column/Field Display Names vs Internal Names
You can change the display name to something more user friendly via the UI after the column has been created. The internal name of the column will remain whatever it was at the point of creation.

Resources