Display only n number of characters of text from Wix database

Hi there! Could you show me how to create a hook that would create a company id using the first character of the first two words the use types into the #companyName field, followed by the 6-digit date the user selects in the datePurchased date input field? For instance, if the user typed My Company Name in the #companyName input field, and selected the date 03/27/2019 in the #datePurchased field, the companyId would be stored as MC032719 in the profile database.