Form Widget not working

yundlu316
Kilo Guru

I am trying to get the form widget to work, but it keeps showing Record Not Found.   When i pull in the Form Widget, I click on the hamburger icon and Open in Platform.   In there, I set the URL/HREF to the form that we want:

https://dev26822.service-now.com/fedhc/?id=form&table=x_81991_federal_hc_federal_onboarding&sys_id=-...

However, it shows as Record Not Found, what am I doing wrong?

1 ACCEPTED SOLUTION

sndangibbard
Mega Guru

For the URL option, no you do not enter anything into the HREF/URL field in the Widget Instance, the Form Widget doesn't use this attribute as far as I know


For the "Additional options" option you need to ensure you keep correct formatting of your JSON object, it should look like this



{


        "disableUIActions": {


                "value": "",


                "displayValue": ""


        },


        "showFormView": {


                "value": "true",


                "displayValue": "true"


        },


        "disableUIActions": {


                "value": "",


                "displayValue": ""


        },


        "page": "incident",


        "sys_id": "-1"


}


View solution in original post

6 REPLIES 6

sndangibbard
Mega Guru

The form Widget pulls in details from either URL parameters passed in the main URL in your browser window, or through the Additional options field on the Widget Instance. For example to get the new incident form to display:


  • Add a Form Widget to a page (I have used csm_index)

Either


  • Navigate to that page and add the table and sys_id parameters to the URL: devXXXX.service-now.com/sp/?id=csm_index&table=incident&sys_id=-1

OR


  • Open Widget Instance in platform as you already have, in the Additional Options, JSON format field, add: {'table': 'incident', 'sys_id': '-1'}


Hope this helps!


Hi Dan,



Thanks for the quick response!   Sorry but I'm still not quite following. I pulled the Form Widget into the page and clicked on the pencil icon to edit and see this pop-up:



find_real_file.png



I then, open in platform and put in that line in JSON format:



find_real_file.png


This still doesn't work.   Also I'm confused about your first option.   If i navigate to page and add in table and sys_id parameters, do I then enter that in the HREF/URL field in the platform?



Thanks.


sndangibbard
Mega Guru

For the URL option, no you do not enter anything into the HREF/URL field in the Widget Instance, the Form Widget doesn't use this attribute as far as I know


For the "Additional options" option you need to ensure you keep correct formatting of your JSON object, it should look like this



{


        "disableUIActions": {


                "value": "",


                "displayValue": ""


        },


        "showFormView": {


                "value": "true",


                "displayValue": "true"


        },


        "disableUIActions": {


                "value": "",


                "displayValue": ""


        },


        "page": "incident",


        "sys_id": "-1"


}


Hey Dan, I changed "page" to "table" and the form showed up!   Just for my own sanity and knowledge, I'm still confused about the URL option.   After pulling in the Form Widget and navigating to that page to add the table and sys_id parameters to the URL, what am I supposed to do with the new URL?   Am I supposed to copy and paste that somewhere?   Thanks!