troubleshooting Question

autofill fields by getting current user and comparing to SQL table

Avatar of askurat1
askurat1Flag for United States of America asked on
Microsoft SQL ServerC#InfoPath
5 Comments1 Solution626 ViewsLast Modified:
What I am trying to do is populate a field based on the current user.
The field I am trying to populate is pulling from a SQL database.

For example, I have one field named Departments. That field is going to pull the department names from a SQL database table but it is only going to get the departments that current user has access too.
So I currently have a data connection pulling the info I need from the SQL table:

Name       Username
-----------------------------------------------
cen           john
cen           bob
chi            john  
chi            bob
la              john
la              bob
la              tim

So as you can see from the table john has 3 departments, bob has 3 departments, and tim has 1 department.

Let's say john is filling out the form, the departments field will only display his 3 departments. If tim is filling out the form it will only show his 1 department in the field.

tim
-------------------------------
Departments: la

john
-------------------------------
departments: cen, chi, la

Now I now how to compare data in info path but not between SQL and the current user.

If I have to do some programming that is fine. I am just curious if this is even possible.

Thanks,
Tony
ASKER CERTIFIED SOLUTION
Ess Kay
Entrapenuer

Our community of experts have been thoroughly vetted for their expertise and industry experience.

Join our community to see this answer!
Unlock 1 Answer and 5 Comments.
Start Free Trial
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 5 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros