Solved

Generate email on new entry on People Picker field?

  • 26 September 2016
  • 1 reply
  • 8 views

Userlevel 5
Badge +13

We have a business requirement for our project site. On a task, there is a multi-select people picker field that people put "Interested Parties" in. These people get certain email updates and such. It has now been requested that we generate an email to any person who is added after the creation to this field. The only solution I can think of for this is to have a field called "Add to Interested Parties," have an email generated to that person (or those people) then append those people to the "Interested Parties" field and wipe out the "Add To" field. 

 

I tried having a second hidden interestedParties2 field so I could check for a diff. But once I saw the diff, I was having trouble determining which was the "new entry" so that I could generate the email (the requirement is to send the email only to the newly added person). 

icon

Best answer by courtney_shelto 23 May 2017, 20:23

View original

1 reply

Userlevel 5
Badge +13

Figured out a way to do this. Have a hidden "Interested Parties" field. On modification, check to see if they're equal. If not, go through the shown IP field and split it with RegEx into a collection. Then do the same with the hidden field. Then have a loop that for each hidden checks if the value exists in the shown, and if so, remove it from the shown. At the end, the collection of shown you're left with will be the new entries. Send emails to those users and then copy/write the shown users into the hidden users field.

Reply