Pre-filling user's phone number


  • Karen Snyder
    Community Moderator

    Hi Robert,

    You can call an API to get the current user data, which contains the user phone number; of course, if the phone number is not set in the user data then your custom field value won't change.

    The following code should work in script.js, assuming that the custom field ID is correct. Make sure you put the code inside the document.ready function.

    $.getJSON('/api/v2/users/me.json', function () {

    .done(function(data) {
        $("#request_custom_fields_123")[0].value =;

    Please let me know if you have any problems.

    By the way, according to this information about the user phone number, it may be stored in a format like +15551234567, which you might want to format with parentheses and hyphens.




  • Robert

    Thank you Karen! It worked like a charm.


Please sign in to leave a comment.

Powered by Zendesk