Sharepoint 2013 LookupSPGroupMembers Workflow Activity
I created a custom workflow activity that writes to history list all users from a specific group.
In this post I will not explain step by step the details to create a custom activity, you can see that in (https://raquelalineblog.wordpress.com/2013/05/11/sharepoint-2013-workflow-custom-declarative-activity/).
I’ll be focused on the detail to iterate through group members Dynamic Value result.
My Custom Avctivity is:
I’ll explain now the details of the principal activities.
We need a LookupSPGroupMembers activity that will put the result in a local variable GroupMembers, of type DynamicValue:
This DynamicValue is an array of DynamicValues, so I”ll get the number of returned elements , I need 2 activities for that (GetDynamicValueProperty, and CountDynamicValueItems from the variable properties).
Next, I need to iterate through the variable GroupMembers to get the loginNames:
I log to HistoryList each LoginName:
The result is: