Set Single Line column to value of Multiline column

Forums Dynamic Forms for SharePoint Set Single Line column to value of Multiline column

This topic contains 2 replies, has 2 voices, and was last updated by  Gerard Graham 2 weeks, 4 days ago.

  • Author
    Posts
  • #18559

    Gerard Graham
    Participant

    Hi there

    I often hide the title field of a list in new and edit forms in favour of using a multi-line text column and using a workflow to sub-string characters from the beginning of the multi-line and setting the title field to that value. All works well, but when used in a task list with email alerts to the assignee the alert is issued before the workflow is finished so the title of the task isn’t included. If the multi-line has less than 255 characters I can set the title field in DFFS, but if there are more than 255 an error is the result.

    Anyone know the code I’d need to use to sub-string the multi-line to get the first 75 characters?

    Thanks, Gerry

  • #18582

    Alexander Bautz
    Keymaster

    You can add this function to the Custom JS – change the “Description” fieldname to match your multiline field.

    function dffs_PreSaveAction(){
        var fullText = getFieldValue("Description");
        setFieldValue("Title",fullText.substring(0,75));
    }

    Alexander

  • #18608

    Gerard Graham
    Participant

    THanks Alexander

    Works a treat

You must be logged in to reply to this topic.