Change ownership of a RingCentral SMS record to the sender of the SMS (bug fix / work around / feature request)

Change ownership of a RingCentral SMS record to the sender of the SMS (bug fix / work around / feature request)

Please watch this video to create a workflow that changes the RingCentral SMS record owner to the text message sender. 



Here is the code: 

  1. recordUpdateMp = Map();
  2. if(input.recId != null)
  3. {
  4. record = zoho.crm.getRecordById("ringcentralmessaging__RingCentral_SMS",recId);
  5. frphone = record.get("ringcentralmessaging__From").toString();
  6. response = invokeurl
  7. [
  8. url :"https://crm.zoho.com/crm/v2/users"
  9. type :GET
  10. connection:"YOURCONNECTIONNAMEGOESHERE"
  11. ];
  12. //info response;
  13. uservalue = response.get("users").toList();
  14. for each  rec in uservalue
  15. {
  16. userid = rec.get("id");
  17. phone = ifnull(rec.get("phone"),"");
  18. if(rec.get("status") = "active")
  19. {
  20. if(phone != null)
  21. {
  22. if(phone.toString() = frphone)
  23. {
  24. recordUpdateMp.put("Owner",userid);
  25. updateRecord = zoho.crm.updateRecord("ringcentralmessaging__RingCentral_SMS",recId,recordUpdateMp);
  26. }
  27. else
  28. {
  29. }
  30. }
  31. //phone not null close
  32. //if phone not ""
  33. }
  34. //if active close
  35. }
  36. //for each close
  37. //info phone;
  38. }