Link SharePoint Groups to InfoPath

G

gevinson

I have an InfoPath 2007 form with multiple views and a single dropdown
control that filters all the content on each view based on what is
selected in the dropdown menu. The drop-down menu holds the list of
"customers". In MOSS I have setup a group per customer and added in
all the users to their respective group. I would like to find a way
to have the InfoPath form recognize what SharePoint group the user
opening the form is from and then auto-filter the data on all the
views. Basically, select the corresponding customer from the drop-
down menu. The SharePoint groups DO NOT have corresponding AD groups:
( I also have to have the InfoPath form backward compatible for IP
2003, however, it doesn't need to be compatible with forms server. I
looked at leveraging the user roles feature in IP, but it only
connects to specific users and AD groups. I also thought of
leveraging workflow, but I don't have a way to kick it off.....I am
using IP as a report instead of a form, so I have the user opening the
xsn file directly and not using the "new form" menu.

Any ideas??

Thanks
Kimberly
 
E

Ed Thurber

I have done this. what i did was to add a column to the customer list that
contained the network username of the individual who has access to the
customer (1 per customer). then in the dropdown of customers i filtered the
list to only include the itemes where the username column is equal to
username() (infopath function).

you may also be able to have a single customer viewable by multiple users
but i have never tested that.

oh, yeah. this will not work with form services as form services does not
support filtering the dropdown list. you would have to use custom code to
do that but it would still filter on the same column.

hope this helps

Ed
 
K

Kimberly

I have done this.  what i did was to add a column to the customer list that
contained the network username of the individual who has access to the
customer (1 per customer).  then in the dropdown of customers i filtered the
list to only include the itemes where the username column is equal to
username() (infopath function).

you may also be able to have a single customer viewable by multiple users
but i have never tested that.

oh, yeah.  this will not work with form services as form services does not
support filtering the dropdown list.  you would have to use custom codeto
do that but it would still filter on the same column.

hope this helps

Ed






- Show quoted text -

Thanks Ed - I have multiple users per customer group....any idea how
to do that
 
E

Ed Thurber

i would start with a list of all of the users. The users column in the
customers list would then be a lookup column from that list with multi
select turned on.
in infopath i would try using 'contains' instead of 'is equal to' (@username
contains username()).

i like to normailze my data as much as possible, so i tend to use lookup
columns alot. if you don't want to get this elaborate, try just separating
the user names with a comma or a space and still use 'contains'

like i said, i have not needed to do this yet, but this is the approach I
would try first.

one issue i did run into was that the comparison operators are case
sensitive. if you cannot guarantee that the value returned from username()
is always going to be the same case as the value in username column of the
customers list, then convert the returned value to upper or lower case and
use the same case in your list. i used the translate() function to do this.

the syntax is translate(username(),"ABCDEFGHIJKLMNOPQRSTUVWXYZ",
"abcdefghijklmnopqrstuvwxyz") - this converts to lowercase
swap the two alphabet strings to convert to uppercase. make sure your
alphabets are in the same order or you'll end up with spelling errors.

Hope it helps.

Ed

I have done this. what i did was to add a column to the customer list that
contained the network username of the individual who has access to the
customer (1 per customer). then in the dropdown of customers i filtered
the
list to only include the itemes where the username column is equal to
username() (infopath function).

you may also be able to have a single customer viewable by multiple users
but i have never tested that.

oh, yeah. this will not work with form services as form services does not
support filtering the dropdown list. you would have to use custom code to
do that but it would still filter on the same column.

hope this helps

Ed






- Show quoted text -

Thanks Ed - I have multiple users per customer group....any idea how
to do that
 
E

Ed Thurber

just wanted to let you know that i just tested both options and they both
work. I like the lookup list option better as you have total control of how
the values are entered. be sure to use 'contains', 'is equal to' does not
work.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top