UI Parameter with Autofill Input source

Derek C
Tera Guru

Hi all,

I have a UI Parameter assigned to a create new function that needs to set a reference field to the user table on a record. The field should auto populate the field on the mobile form to the logged in user. However, whenever I set the "input source" to "autofill" and set the "input type" to "user" (per this doc https://docs.servicenow.com/bundle/orlando-mobile/page/administer/tablet-mobile-ui/task/sg-assign-pa...) the field is no longer appearing on the form. If I set the "input source" to "user input" and the "input source" to "SearchList" it works fine. I can even set the default value to javascript:gs.getUserID(); and it will populate the value correctly. 

I'd prefer to use the autofill functionality if possible, does anyone have any suggestions on what may be happening or how to fix it?

Thanks!

1 ACCEPTED SOLUTION

Mike Patel
Tera Sage

Autofill will not show field on view but it will auto populate the value in backend. If you want to show field on form then using default value and make it ready only is the best approach.

View solution in original post

5 REPLIES 5

Mike Patel
Tera Sage

Autofill will not show field on view but it will auto populate the value in backend. If you want to show field on form then using default value and make it ready only is the best approach.

Hi Mike, I tried this out this morning and you're correct it does work. Interesting that they don't display the field.

I'll use the default value approach. Question with date fields, do you know if you can populate the default value of a date/time? I've tried javascript:gs.nowDateTime(); but that doesn't seem to work... thoughts?

Thanks again!

- Derek

I never had requirement to do date/time default so I'm not sure about it.

try few thing

  • new GlideDateTime();
  • gs.now();

Yeah... tried both of those with no luck... all well, thank you!