Hi,
Can any body please help. I want to use/execute below code in workflow custom action for sharepoint online site. I actually want to develop workflow custom action to further use it in SharePoint designer 2013 for a sharePoint Online site:
using (SPSite site = new SPSite(context.CurrentWebUrl))
{
using (SPWeb web = site.OpenWeb())
{
string groupName="";
foreach(SPGroup spg in web.Groups)
{
spg.Name.Contains("Approvers");
groupName=spg.Name.ToString();
break;
}
SPUser user = web.EnsureUser(web.CurrentUser.Name);
if (user.Groups.Cast<SPGroup>().Any(g => g.Name.Equals(groupName)))
{
results["IsApproverUser"] = true;
}
else
{
results["IsApproverUser"] = false;
}
}
}
Thanks
Atiq