Solved

Sending email to sharepoint group as dynamic name


I have a workflow that dynamically assigns a SharePoint group name to a variable and then use that variable in To: field on an email action. I am selecting the variable name with the advanced option and using the "Email addresses" or "Email addresses separated by semi colon" and both do NOT return any email addresses. Whereas if I enter the sharepoint group name manually it does resolve the name and send emails to the group members!

 

I thought this had worked on a previous project, but now not sure, so can anyone please confirm if this approach should work or has recently changed?

icon

Best answer by courtney_shelto 27 June 2017, 22:05

View original

10 replies

Userlevel 5
Badge +13

dynamically assigns a SharePoint group name to a variable

What kind of variable are you assigning the SharePoint group name to?

A text variable. Does that make the difference if I use another variable type?

I just tried using the "People or group" variable type and still didn't work!

Userlevel 5
Badge +13

Did you make sure on your people or group variable that it's configured it to also accept groups? Like so:

Yes, I did. The only other option I'm thinking of is to create a collection variable and somehow pull out the people in the group and write their email addresses to the email action?!

Userlevel 5
Badge +13

Why do you need to assign it to a variable rather than just selecting the group in the email action?

It's a complicated WF that I inherited. It sets up to 9 different group emails depending upon the stage of the approval. The email To: CC: Subject: and Body: are all variables which are used via one email action. And I don't want to re-engineer it all unless I have to!

Userlevel 5
Badge +13

Hmm, ok, is this a SharePoint exclusive group or an AD synced group? In any case, I did some tests. I couldn't get the email addresses to log to the workflow history for either an AD synced or SharePoint only group when assigned to a variable and logging the variable as "Email Addresses." I tried allowing and disallowing "multiple values" as well.

Then, I set the variable to a SharePoint group and for the email action, put the workflow variable in the "to" field without formatting it at all. It still wouldn't print the "Email Addresses" to the workflow history, but putting it in the email field without formatting it at all worked and sent the email to the group users!

You are a genius!! How strange to not apply formatting and it works.... one of those don't ask why and go with it  

You've just saved me a lot of re-work, thanks.

Badge +9

@phil_duffy @courtney_shelto ,


Could you please elaborate what do you mean by "not apply formatting"? I do not see anywhere in the send notification action.


I inserted the persongroup variable into the BCC field and createdby in the TO field. I do just have a email string variable that shows table of field contents from the list, which is shown as rich text. Are you saying to put the body as plain text?


This works in one of my list when i test it as it does not have any email string on the body section but just plain text, but does not work on the actual one where it has.


 

Reply