LS7
ServiceNow Employee
ServiceNow Employee

This article is the digital forum for the K23 ServiceNow Application Development Fundamentals pre-conference learning experience.

 

We are using this article for a few different functions:

  1. Introduce yourself and connect with others
  2. Ask questions and provide answers
  3. Any resources you want to share

 

Classroom staff will be monitoring this conversation during class May 14-15, 2023 and will answer to the best of their ability. NOTE: This article will not be monitored post-conference, but feel free to continue the conversation.

Comments
Anjali Malik
ServiceNow Employee
ServiceNow Employee

@JasonH5  - the data type for a 'Date' field is either date or date/time - there are no capital letters there! What say @That Phil Guy ?

 Please add if anything. Does that answer your question @JasonH5

 

That Phil Guy
ServiceNow Employee
ServiceNow Employee

@JasonH5 
I think it's enforced somehow. I think it always must be in_sssnake_case_like_thisss.

It doesn't seem to be stored in the Validation Scripts table, so I'm not sure what logic checks for it—but I'm pretty sure it's in there somewhere! 😅

That Phil Guy
ServiceNow Employee
ServiceNow Employee

About field labels:

To name a child table's field label such that it overrides its parent table without screwing up labels on other tables, you'd create a record on the Field Labels table. This is also how you handle localization for field names: there's a language column which allows you to create a label for each language your instance supports.

CurtisSmithNC
Tera Contributor

Shoutout to Arnoud Kool's SNUtils plugin for making tracking labels/names on forms easier by allowing developers the ability to toggle showing technical names on and off.

Ben Cuddington
Tera Contributor

Hi, I'm Ben.   I've created a couple scoped apps prior to this class & had some questions regarding design considerations.   For example, you have one step where we created a group in the main window which is in the Dev instance.  (Loaner Request Users)  This is not tracked/moved in update sets is it not?   What is the best strategy for having this unified across instances (Dev/QA/Prod) when developing?

 

Currently, I've learned a few things that don't move in update sets (and still new to Link to Source Control / Repository), but the sys_id would change would it not if you have to create a new group in each instance?   Or say, you create a group for which the role is to be applied in Production.    If this is the case, are there some things that should be done prior to development in Studio (in Production) and moved down in an exported XML record?

JasonH5
Tera Contributor

@Ben Cuddington  one tool I have found invaluable for this is https://snprotips.com/include-in-update-set-tool

 

That Phil Guy
ServiceNow Employee
ServiceNow Employee

@Ben Cuddington 

Great observation about the group records! Those aren't considered customizations, so neither Update Sets nor Application Files will capture them. 

 

In the case of a scoped app, you can force them into the Application Files table as "sys_metadata_snapshots." In fact, we do that in a future lab in this course. But! Remember, roles are captured as customizations. And then remember the many-to-many records on tables like sys_user_grmember, sys_user_has_role, and sys_group_has_role which glue all this together are not. O_o;; 

 

I think if it were me, I'd recreate the groups in Production. But, you could get away with moving over those many-to-many records. That's complex, though. For example, on some of those many-to-many tables, you need to change the Dictionary Attribute called "Metadata Link Exempt" to false. Better to treat the roles as customization artifacts (as they are) and the groups and users as "mere data" (which they are). 

 

But, that's "if it were me." You may want to get a second opinion from folks like your Active Directory admins, instance architect, etc. etc.

 

Michael Keon
Tera Explorer

It asks why the view we created named "ESS" shows up with the name "Self Service", I don't know the answer...

Anjali Malik
ServiceNow Employee
ServiceNow Employee

@Michael Keon - well, ESS is named as 'Self-service'. So, simply put, ESS is the name and Self-service is actually the title. That's the reason for the different view to appear VS what you named it. 

Pro tip: for future reference, you can access the lab answer guide - the resources you download from your instance has the lab answer guide.

 

Hope this helps! 

Rob Bushrod
Tera Guru

@Ben Cuddington - I would always do what you are suggesting and create in Prod and then export to XML. You want a consistent sys_id value across all instances. Of course best practice there would be regular clones and so the Prod sys_id would make it's way into subprod instances that way, from my experience those regular clones can be hard to schedule. This is especially important if you have assignment groups set in scripts where it uses the sys_id.

That Phil Guy
ServiceNow Employee
ServiceNow Employee

Referring to @Michael Keon 's question (but also a general statement):
Everything in ServiceNow is a record in a table—including Views! Check the module called System UI --> Views. As Anjali said, "ess" is the system name of that View record, and "Self-Service" is its label. So, when we created a view on our table called "ess", ServiceNow went "Aha! I know that name!" — and returned its more user-friendly label. 

 

rafi438
Tera Contributor

If a customer doesn't have a GIT repository linked(which I came through with most of my customers) but doesn't want to work with Update sets, instead just wants to rely on the APP Repository approach, How to save the editing access of that custom app in source instance during the cloning process? Are there any steps to be taken care to preserve this scope from getting cloned on the source?

SNOW-Padawan
Tera Explorer

@rafi438 We had something similar to this come up recently at my organization. We found that the application must exist in a development state or have been published to that instance before the clone. Below is an article that gave us some direction. The rest of the direction we received was from a SNOW Rep that pretty much confirmed our theory.

https://docs.servicenow.com/en-US/bundle/utah-application-development/page/build/applications/task/p...

Ben Cuddington
Tera Contributor

I hope we cover the source control scenario on Dev instance before cloning in this class.   That has been problematic in some of my reading.   Obviously for possibly tomorrow.

That Phil Guy
ServiceNow Employee
ServiceNow Employee

@rafi438 , @Ben Cuddington 

I'm really speculating here! Notice that this class is more about "let's make an application!" and doesn't usually discuss cloning at all.

 

First: during a clone, records on the target instance are deleted, and then records on the source instance are brought over. If you create a Data Preserver, it prevents records in the target instance from being deleted during that first bit. If you create a Table Exclusion (module is called "Exclude Tables"), it prevents source instance records from being copied over. Creating both for the same table means that nothing changes on that table in either instance. I've made a chart to try and clear that up.

Clone Preservers & Exclusions.png

 

Now, in Data Preservers, we can only select whole tables. Maybe you could try preserving the "sys_app" table so that no scoped app components get deleted in the target instance? I'm not sure if that's a smart move or not. 😅

 

With Table Exclusions, you can add a filter with the filter condition builder. So, if you see this image, I've made an exclusion for the sys_metadata table (the root of all Application Files), and set the Application field to "Loaner Request". I'm fairly confident this would prevent all components of that application from coming over from the source instance. 

 

Screenshot 2023-05-14 at 4.44.00 PM.png

Finally, this Community thread looks relevant and may be more helpful than my suggestions.

 

LS7
ServiceNow Employee
ServiceNow Employee

Developer Learning Path graphic

LS7_0-1684130722813.png

 

LS7
ServiceNow Employee
ServiceNow Employee

Business Rule Process Flow graphic

LS7_0-1684130819950.png

 

LS7
ServiceNow Employee
ServiceNow Employee
LS7
ServiceNow Employee
ServiceNow Employee

ServiceNow Certified Application Developer (CAD) Exam Specification

Utah Release – Updated April 2023

https://nowlearning.servicenow.com/lxp?id=kb_article_view&sys_kb_id=1052565087792910bfe94088dabb35b6

 

 

JamesLindsay
Giga Guru

Great stuff yesterday...so many things came back to me that will be very useful in the projects I have coming in CMDB, CSDM, ITOM, ITSM, etc.

That Phil Guy
ServiceNow Employee
ServiceNow Employee

Great to hear, @JamesLindsay ! It gets real juicy today—lots of neat stuff coming up!

SNOW-Padawan
Tera Explorer

I think the biggest thing that I learned from yesterday was Macros. I have been scripting things by hand and providing the code for people in my organization as "templates." Macros are by far the most useful thing, for me, that was learned. Not sure why I didn't know about them sooner!

Massive thank you!

Aja-Johnson
Giga Guru
Giga Guru

Hi everyone! I'm Aja 😊 I'm from Chicago and I've been working in the ServiceNow ecosystem for 2 months with American Family Insurance as an Engineer. I have a background in education and worked as a Speech Language Pathologist for 10 years before participating in the NextGen externship program in 2022.

 

I found the information about Git so helpful. Excited for today! 

Rob Bushrod
Tera Guru

Biggest question I had yesterday was around how it works with domain separation as my company's instance is domain separated. @That Phil Guy kindly helped with that at the morning break. The macros was also a pretty cool feature I didn't know about, so will look to make use of those moving forward.

Ben Cuddington
Tera Contributor

@That Phil Guy ,

Not to be that negative-nancy, but I'd definitely struggled with this one (Dev cloning over "in-dev" scoped application) & it was a struggle to find official documentation.  The link referenced in that community article has the following:  Preserve unpublished applications during a system clone which appears to be a dead link.  After our last clone, we had to go to each scoped application & make some changes & possibly this would be the best method as you've suggested.   It would seem like something that ServiceNow would want to have in development potentially as there is a push for creating custom apps & if a clone is going to "by default" wipe an application out or not register that it is the development instance, there could be a means to recognize the instance from which it was created.   Much like when publishing to the company app store, where the other instances recognize that it isn't the one from which it was created.   (An example being the ability to install, vs. "Edit in Studio". )   

BenCuddington_0-1684167875923.png

 

Perhaps this is more of a suggestion for CreatorCon, so sorry for being long-winded.

 

ddchon14
Tera Explorer

Good morning,

 

We've been creating the application files (i.e. UI Policies, Business Rules, etc.) via Studio.  What's the best practice - should these files always be created in Studio or is/are there a use case where it might make more sense to create them in the main SN browser?

 

Thank you

Ben Cuddington
Tera Contributor

Scratch that, the URI has the wrong/outdated release, edited for "london" to be "tokyo" :   https://docs.servicenow.com/bundle/london-application-development/page/build/applications/task/prese...

Max23
ServiceNow Employee
ServiceNow Employee

@ddchon14 you can do it either way even if you create your scripts or other artefacts for your application in the main browser they will still be reflected in Studio after creation and you can work on them in Studio as well. 

 

Community Alums
Not applicable

Hello, for validating the start and end dates. Is there any reason we didn't utilize the Client Script instead of Business Rule?

JasonH5
Tera Contributor

So the App repository is not our Git repository, Is it available for PDIs?  Is there a way to make 2 PDI instances have the same company code so we can test out the publish/install process?

JasonH5
Tera Contributor

@Community Alums I was going to ask the same thing.  I think I have created UI Policies to do just this same thing before.  It would allow you to warn the user before trying to submit the update.

That Phil Guy
ServiceNow Employee
ServiceNow Employee

Scratchpad JSON works! (Display BR and onLoad Client Script)

Screenshot 2023-05-15 at 10.30.05 AM.pngScreenshot 2023-05-15 at 10.30.14 AM.pngScreenshot 2023-05-15 at 10.30.20 AM.png

Harshvardhan11
Tera Contributor

What does the 3 options mean when creating Application Files from Records(adding data to application)? It shows

  • New Install and Upgrades,
  • New Install
  • New Install with Demo data
That Phil Guy
ServiceNow Employee
ServiceNow Employee

Hello @Harshvardhan11 ! Here's the documentation on that feature. Briefly:

 

New Install and Upgrades Includes application data whenever the application is installed or upgraded.
New Install Includes application data only when the application is installed.
New Install with Demo Data Includes application data only when the application is installed with demo data.
That Phil Guy
ServiceNow Employee
ServiceNow Employee

@ddchon 

As long as you're in the correct scope in the main tab, there's not really a downside to either approach. I generally prefer working in Studio as it tends to be more focused and convenient, but if you happen to be in the main tab and make an edit/customization there (with the Scope Picker set correctly), no big deal! Studio will know about it. So, a matter of personal preference and context.

I'd recommend against this if you have the Form Design tool open in Studio, though. It doesn't get the heads-up about any changes made in the main tab unless you close&reopen the Form Design.

That Phil Guy
ServiceNow Employee
ServiceNow Employee

@JasonH5 

I'm not aware of a way to get two PDIs to connect together. I know we begged and pleaded for some special backend work to allow connection between two instances in class, and if I'm honest, I've no idea how that sorcery was done. 

That Phil Guy
ServiceNow Employee
ServiceNow Employee

@Community Alums 

Using the business rule approach is a little more "stern." It rejects the record to prevent an update. it could be that the course author originally chose that approach for reasons of instructional design, too. 

 

I suppose in a UI Policy you could build a complex set of conditions in the filter condition builder that looks to see if (1) the date fields aren't empty, and (2) the end date is before the start date, and then clear the field using a UI Policy Action? Maybe? But it'd be entirely client-side. Up to you!

CurtisSmithNC
Tera Contributor

Shoutout to whomever wrote this training bit on ACLs. I've completed the System Administrator fundamentals course, and have my CSA, and I feel like this is best presentation and training on ACLs that I've seen so far from ServiceNow. Great work!

ddchon14
Tera Explorer

What's the reasoning from jumping from 1.1.0 v to 2.0.0? Is there a protocol for numbering versions?

CurtisSmithNC
Tera Contributor

When you use the "Create Application Files" link on a table for a scoped app, does it only grab whatever is there when clicked? Or, does it continue to grab whatever is in the table for future publish/installs? Also, assuming we select "New Installs and Upgrades" does it keep those application files as part of the published app and re-install them each upgrade (potentially overwriting changes to those files in the target instance)?

 

IE. If I create some default application files with the option "New Installs and Upgrades" before publishing version 1.1.0, will it?

1. Only load those files when 1.1.0 is installed?

2. Only load those files when version 1.1.0, or higher is installed?

3. Load those files and any new files in that table when version 1.1.0 or higher is installed?

4. None of the above?

 

And can you confirm if the application files will overwrite modifications to the target instance application files?

Harshvardhan11
Tera Contributor

@CurtisSmithNC : I tried this. Create Application Files only add those files which are in list. If no filter than all records of the table, if filter applied then only those records.

 

The 3 options focuses on when these will be moved to test via application repository. If New Installs and Upgrades is selected, then with next upgrade (assuming application was published after creating application files), those records will also be created in TEST insatnce

JasonH5
Tera Contributor

What would be a practical application to use the 'Caller Restriction' option?  Normally you have apps read/write data because you want to automate a process, probably many times over the course of a given period of time.  If I had to manually approve each of those interactions, wouldn't that defeat the purpose of the automation (not to mention taking up all of my work time approving server interactions)?

That Phil Guy
ServiceNow Employee
ServiceNow Employee

 Hey @CurtisSmithNC !

 

This documentation link might clear things up.

 

The "Create Application Files" action kind of subverts the whole "apps and update sets usually don't capture data" thing. It's intended for demo data, not for moving records whose statuses and the like are meant to be used in any real production process. When you use this UI Action, you create something called a "metadata snapshot," essentially linking that record to the sys_metadata table, where all your Application Files reside. 

 

I just tested this a bit, though, and I'm a bit surprised:

 

  1. I added a record using this process (with "New Install and Upgrades" selected), then published and installed the app in Test.
  2. I then updated that record in Test, and republished from Dev. 
  3. I expected the updated app to overwrite the local change to the record I had made in Test. It didn't. It honored the local version.
  4. Then, I updated the record in Dev without using "Create Application File," and re-published. Unsurprisingly, no change to the record in Test after install.
  5. Finally, I used "Create Application File" and published one last time. This time, the new snapshot did overwrite the record in the Test instance. It must have detected that this metadata snapshot was newer than the existing record in the Test instance, and thus it was overwritten (compare to step 3, wherein the metadata snapshot was older).

 WHEW!

That Phil Guy
ServiceNow Employee
ServiceNow Employee

@JasonH5 

Yeah, I often wonder about the practical, real-life process of Caller Restriction. It does seem like it'd be a bit of a pain to manage those approval records. But, I suppose in cases where it's like "look, this specific artifact can't be used by that application unless we say so," that's how it can be controlled. Beats the former binary approach, right?

 

Curious to know whether anyone here has to manage those Caller Access records...

Andy Minnich
Tera Expert

Is there another way to check the status of your application on the repository? I published my app before lunch and it still hasn't shown up in Test as updated. Studio in Dev shows that it is published as 2.0.0, but in my Test instance, I do not have an upgrade available from 1.1.0.

Rob Bushrod
Tera Guru

Why during the demo when limiting to 3 did the system return 3 values that weren't sequential. What is driving that query through the GlideRecord or is it random?

That Phil Guy
ServiceNow Employee
ServiceNow Employee

@Andy Minnich , forgive me if you and I already talked about this (maybe it was someone else?).

As a "fishing with dynamite" approach, I thiink you can tell the process that's doing the publication by clearing any recent records on [sys_progress_worker] and [sys_execution_tracker] (in the Dev instance? or Test? I can't remember!), and then go to [sys_store_app] in the Test instance and find the Loaner app and uninstall it. Wild, huh?

That's what I can think of. I'm not sure how to get a look at what's going on in the App Repo. I bet there's a way! I just don't know it yet. 😭

That Phil Guy
ServiceNow Employee
ServiceNow Employee

@Rob Bushrod 

I think it must've returned the first three that it found. I've also noticed that unless told otherwise, ServiceNow tends to order things by creation date in many cases (and other data points in others). 
But! You can use .orderBy('field_name') and .orderByDesc('field_name') in your GlideRecord queries if you wanna sort by a specific field!

That Phil Guy
ServiceNow Employee
ServiceNow Employee

Struggling to test Lab 6.1? I made this videointended for fellow instructors—several releases ago, but it should be close enough to give you a rhythm for it. I'd try doing your own approach first and following the lab, but the video could be helpful (albeit being 11 minutes long—watch it at 2x speed maybe? 😅). 

 

Trevor Jerue1
Tera Contributor

I noticed while testing 6.1 that there's a use_polaris parameter that's set to false when opening records from Flow Designer. Is there a way to always have the links use the Next UI? I did not see a property documented on the SN Docs page.

 

Edit: I found this community response and could be related?

Version history
Last update:
‎05-17-2023 10:53 AM
Updated by:
ServiceNow Employee
Contributors