Question

How do I add a custom field via Widget API?

  • 20 October 2021
  • 1 reply
  • 579 views

<script>
        window.fwSettings = {
            'widget_id': 67000000128
        };

        var url            = window.location.href;
        var systemName    = "VuPoint Ticket";

        var pathArray    = window.location.pathname.split('/');
        pathName        = pathArray[0];

        if (pathName)
        {
            switch (pathName.toLowerCase) {
                case "asset":
                    systemName = "Asset Manager Ticket";
                    break;
                case "servicequote":
                    systemName = "Service Quote Ticket";
                    break;
                case "order":
                    systemName = "Order Ticket";
                    break;
                case "customer":
                    systemName = "Customer Ticket";
                    break;
                case "newproductquote":
                    systemName = "New Product Quote Ticket";
                }
        }

        FreshworksWidget('prefill', 'ticketForm', {
            type: '${systemName}',
            custom_fields: {
                cf_setpointSystem: '${systemName}',
            }
        });

        !function () {
            if ("function" != typeof window.FreshworksWidget) {
                var n = function () { n.q.push(arguments) };
                n.q = [], window.FreshworksWidget = n;
            }
        }();

    </script>


1 reply

Userlevel 5
Badge +9

Hello @robertkgaudet,

 

Apologies for the delay in getting back here. We can see that you have already contacted our support via this ticket. Feel free to drop a note here for any further questions and we would be happy to help! :)

Documentation on how to use help widget APIs in Freshdesk: 
https://developers.freshdesk.com/widget-api/#introduction

 

Thank you!

Reply