wms_debra

Absent Member.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
2012-11-29
18:15
857 views
Group/User Dependency
Do anyone know how I can create a multi-group field and based on what group is selected populate another field with the Users of that group.
2 Replies
pmthompson1954

Absent Member.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
2012-12-01
04:10
Re: Group/User Dependency
Q. What kind of field do you want to populate with the Users of the Group?
You can do it (relatively easily) with App script. The field value will be an SBM "CSV" format list, meaning a Comma-separated-values list with COMMA chars at the beginning and end. An empty list is supposed to be ",," (COMMA,COMMA) but can be blank or a single COMMA (just to make life interesting). A field with two group IDs looks like ",123,456,".
You will need to parse on the COMMA, get a single numeric Group ID then query TS_MEMBERS where TS_GROUPID == the numeric group id. There will be one record in TS_MEMBERS for each user in the group so you will need to use an AppRecordList to do the query, then iterate that object using an AppRecord. For each AppRecord, get the TS_USERID field value. Use this to assemble a CSV string of user IDs which you will (eventually) put into your field.
That's assuming you are putting the group members into a multi-user list.
wms_debra

Absent Member.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
2012-12-07
17:43
Re: Group/User Dependency
Hi Paul, I didn't see your response until now. I don't care what type of field it is. I just need to have all the groups in one field and based on the group selection populate another field with only the members of that group. Do you have a sample script that I can use? Appreciate any help.