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:

WFGM2

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:

WFGM3

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).

WFGM4

WFGM5

Next, I need to iterate through the variable GroupMembers to get the loginNames:

WFGM6

I log to HistoryList each LoginName:

WFGM7

The result is:

WFGM1

Advertisements

Tags:

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: