Rules Error Set Field Value using People Picker

Forums Classic DFFS Rules Error Set Field Value using People Picker

Viewing 3 reply threads
  • Author
    Posts
    • #27342
      Brett
      Participant

      Hi Alexander,

      I’m using v4.4.4.5 and getting an error when I use a rule to move the value of a people-picker to another people picker.

      My name is displayed as: Anderson, Brett [AU-AU]
      And it splits my name in half due to the comma:
      Andersonx Brett [AU-AU]x
      You can only enter one name.
      image also attached.

      Thanks for your time.

    • #27345
      Brett
      Participant

      I also just tried a Custom JS function:

      
      
      function copyApprover(){
      setFieldValue("ReqApprover","Approver");
      }

      But the Rule fails to trigger the Custom JS for this either and no errors in the console.
      Can you please check if a people-picker’s value can be copied on “Field change”?
      Thanks.

    • #27369
      Alexander Bautz
      Keymaster

      The reason is like you said the comma. Use this to set the value using the username and not the display name:

      var ppArr = spjs.utility.getFieldValue({"fin": "PeoplePicker1", "key": "loginname"});
      setFieldValue("PeoplePicker2", ppArr[0]);

      Replace PeoplePicker1 and PeoplePicker2 to match your fields.

      Alexander

    • #27399
      Brett
      Participant

      Thanks Alexander,

      That works perfectly.
      Much appreciated.

Viewing 3 reply threads
  • You must be logged in to reply to this topic.