How to add a Country Flag icon on a incident or change request record

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-20-2022 07:09 AM
Hello,
How would I be able to show a country flag on a incident or change form?
Like:
We have customers in different countries and I would like to show a flag icon next to the company name.
I know you can an reference attributes on User level (ref_contributions=user_show_country) but I would like to show it on company/account level and not on user level.
The company record had a field 'country' which contains a land code (for example: USA)
I thought it can be done with field styles, but I'm completely stuck.
Google show some info that could be correct but I cannot open the link
The content you requested cannot be displayed right now. It may be temporarily unavailable, the link you clicked on may have expired, or you may not have permission to view this page.
https://community.servicenow.com/community?id=community_question&sys_id=f23105b1db5ae450f77799ead39619a3
Anyone who has this in place on your instance and could/would help me out?
We are also on CSM, and I also want to use/show it in Agent Workspace.
I hope this can work also.
- Labels:
-
Change Management
-
Incident Management
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-25-2022 05:48 AM
Hi Frans Brus - NorthC,
I found a article related to attaching a image icon with the field,

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-26-2022 08:17 AM
I have figured out how to present it on Change Level (on a form) and also on Account Level (form)
I created a Style without JavaScript condition.
But I want to show a country flag based on a field within the Account record.
The company shows a flag of the actual company based on a Script Include is correct in a list view.
This is the Script Include:
var AccountFlag = Class.create();
AccountFlag.prototype = {
initialize: function() {
this.country = current.country;
this.CHGcountry = current.company.country;
},
//True if country code is NL
NL: function() {
return this.country == 'NL';
},
//True if country code is DE
DE: function() {
return this.country == 'DE';
},
//True if country code is CH
CH: function() {
return this.country == 'CH';
},
//True if country code is NL on change
CHGNL: function() {
return this.CHGcountry == 'NL';
},
//True if country code is DE on change
CHGDE: function() {
return this.CHGcountry == 'DE';
},
//True if country code is DE on change
CHGCH: function() {
return this.CHGcountry == 'CH';
},
type: 'AccountFlag'
};
If I refer in the style to the Script Include with "javascript:new global.AccountFlag().DE();"
It does work in a list view, but not in a form view
Can this be done with a style or should I use a Client Script?