Skip to main content
Closed for Voting

Custom Fields are not prefilling

Related products:Freshdesk
  • August 19, 2020
  • 1 reply
  • 59 views

  • Apprentice

I have added this to my HTML page after the script javascript. I am able to prefill the subject but not the custom fields. I have tried topic and cf_topic and in the custom field are with no luck. Support is not providing any documentation how and why this works, without the identification of my widget, I am not able to identify the source. I do not want to do any Curl command or coding to access the API. If it works with subject using the javascript, it must work for the custom fields.


<script type='text/javascript'>

FreshworksWidget('prefill', 'ticketForm', {

  subject: "XXXXX",

  cf_topic: "Hello",

  custom_fields: {

  cf_topic: "Hello",

  }

});

FreshworksWidget('hide', 'ticketForm', ['subject']);

</script>

1 reply

Hello there,


Custom fields like topic would have to come under the custom fields section as shown below: 


<script type='text/javascript' src='https://widget.freshworks.com/widgets/"this would be your helpwidget ID".js' async defer></script>

<script>

  FreshworksWidget('prefill', 'ticketForm', {

  subject: 'order',

  description: 'I received a damaged product',

  priority: 1,

  status: 3,

  custom_fields: {

    cf_number_field: 103,

    cf_single_line: 'Set text as',

    cf_merge_close: 'Yes',

    }

  });

</script>


Hope this helps. 


Cheers!