Home > Forum > Data sources > Group Members function in data source filter with "person or group" field as parameter

Group Members function in data source filter with "person or group" field as parameter
0

Hi,

we would like to pick a group in a form field and to use all members of this group as filter for another user picker field.

Using the function GROUP MEMBERS [AD-Group Login and name] in a business rule works fine. Setting this one into an ALERT all members are returned as expected.
Using 'testgroup' as string in the group picker of the function GROUP MEMBERS ['testgroup'] in a filter of a data source works fine and all members are returned as expected.

But using the AD-Group field in the function GROUP MEMBERS [AD-Group Login and name] in a filter of a data source always returns no result. The name of the AD-Group field is "testgroup" - tested with an ALERT.
It would be great if passing a "person or group" field to the "group member" function would work as it does in the business rules. Could this be a bug? Or are we missing anything?

Kind Regards
Sébastien

In reply to: Przemysław Prostko

I checked and indeed, there is a small problem.
As Raluca pointed out - you can see what the SQL query for filtering looks like.
WEBCON changes the text formatting by adding '.
The easiest way would probably be to change it to Advanced Filtering and add the appropriate entry

Hi,

thanks for your help both of you!

Indeed I can confirm this quote problem:
COS_ID IN (SELECT COSET_COSID FROM [dbo].[CacheOrganizationStructureExtendedTokens] WHERE [COSET_TokenPart] IN ('''testgroup'''))

Using this as advanced filter with the field [AD-Group (Login)] works as it expected:
COS_ID IN (SELECT COSET_COSID FROM [dbo].[CacheOrganizationStructureExtendedTokens] WHERE [COSET_TokenPart] IN ('{I:123}'))

Thanks a lot for this workaround! Much better than setting the values in a technical field and so on ... :)

@Webcon: Would it be possible to "fix" this quote problem? It would be great if one could use the visual filter with group members out of the box.

Kind Regards
Sébastien

Did you know that with WEBCON you can automate virtually any process? Even baking cookies 🍪
 
Speaking of cookies: we use the ones that are essential for our website to function properly, as well as additional ones that help us customize our content to your preferences. If you don’t mind cookies, click Accept. If you want to learn more, explore settings.
Settings