nowGurukul
Tera Guru
Tera Guru

 

ServiceNow Community - “Discipline is choosing between what you want now, and what you want most.” 🌟

 

Challenge Introduction:- In order to strengthen the ServiceNow hands-on skills , each week a challenge will be posted and you need to implement the solution in your Personal Development Instance and share the screenshots of the completion in the post comments and your take home learning for this week Challenge.

 

Benefits:-

  1. A weekly implementation challenge in order to do goal based learning.
  2. An opportunity to connect and learn from thousand of others ServiceNow Enthusiasts who are part of nowGurukul community.
  3. An opportunity to learn and implement exciting features & functionalities of ServiceNow platform every week.
  4. Real time project based learning opportunity which can be used in your resumes in order to showcase how competent you are in implementing ServiceNow hands-on solutions.
  5. Opportunity to innovate and come up with your creative solutions for the challenges in order to grow your ServiceNow competency.

and much more....

 

Challenge Guidelines:- 

  1. Kindly use your personal development instance for the challenge implementation.
  2. In case of any assistance/discussion required , please use nowGurukul Official What's App Channel for the quick resolution.
  3. Wherever needed assume the values in order to complete the challenge as you are independent enough to bring in your creativity in your hands on implementations.
  4. Make sure you follow Best Practice wherever applicable.

*****************************************************************************************************************

Prerequisite:

 nowGurukul ServiceNow Hands-On Challenge 2024 #Week_1

https://www.servicenow.com/community/developer-articles/nowgurukul-servicenow-hands-on-challenge-202...

 

Week-2 Challenge:-

For this week, as part of the end to end project implementation, we will be configuring few Application Menus/Modules. Then we would be create new Catalog Item and Record Producer with variables and variable set.

 

Application Menu/Modules:

Application Name: Corporate Gifting

Modules:

  1. All Employees – List of Employee Table all records.
  2. My Employees – List of employees whose manager is Me (logged in user).
  3. Create New Employee – New form to create Employee record.
  4. My Requests – List of E-Wallet Request requested by Me (logged in user).
  5. Requests assigned to Me - List of E-Wallet Request assigned to me (logged in user). This module should be visible only to HR Agents.
  6. Requests assigned to My Group - List of E-Wallet Request assigned to my Groups. This module should be visible only to HR Agents.
  7. Closed E-Wallet Requests – Available to only HR Agents. List of E-Wallet Requests which are closed.

 

Catalog Items:

Name: E-Voucher Request

Catalog: Service Catalog

Category: Corporate Policies/Benefits (New Category)

Short Description: To raise request to avail E-Voucher based on E-Wallet balance.

 

Variable Set:

Requested By – Read-only, Auto populated by logged in user.

 

Variables:

1. Project/Account – Read-Only. Auto-populate based on Requested By from Employee record.

2. E-Voucher Type - Choice Values-

  1. E-Commerce (Default)
  2. Shopping
  3. Sports Wear
  4. Food Delivery

3. E-Voucher Brand: Choice Values with None option:

  1. Flipkart (Visible only when E-Voucher Type is E-Commerce)
  2. Amazon (Visible only when E-Voucher Type is E-Commerce)
  3. Myntra (Visible only when E-Voucher Type is E-Commerce)
  4. Lifestyle (Visible only when E-Voucher Type is Shopping)
  5. Allen Solly (Visible only when E-Voucher Type is Shopping)
  6. Zomato (Visible only when E-Voucher Type is Food Delivery)
  7. Swiggy (Visible only when E-Voucher Type is Food Delivery)
  8. Puma (Visible only when E-Voucher Type is Sports Wear)
  9. Adidas (Visible only when E-Voucher Type is Sports Wear)
  10. Nike (Visible only when E-Voucher Type is Sports Wear)

 

4. E-Voucher Amount:

  1. Rs.100 (Visible only when E-Voucher Type is Food Delivery)
  2. Rs.200 (Visible only when E-Voucher Type is E-Commerce, Food Delivery)
  3. Rs.250 (Visible only when E-Voucher Type is E-Commerce, Sports Wear)
  4. Rs.400 (Visible only when E-Voucher Type is Shopping, Food Delivery)
  5. Rs.500 (Visible only when E-Voucher Type is E-Commerce, Shorts Wear, Shopping)
  6. Rs.750 (Visible only when E-Voucher Type is Shopping, Sports Wear)
  7. Rs.1000 (Visible for all E-Voucher Type)

 

5. Quantity: Choice Values:

  1. 1 (Default)
  2. 2
  3. 3
  4. 4
  5. 5

6. E-Voucher Price: Read-Only and Auto-populate based on E-Voucher Amount and Quantity. (E-Voucher Amount*Price).

 

7. Comments: Multi Line String Text.

 

Record Producer:

 

Name: Raise E-Wallet Request for your Mentee

Catalog: Service Catalog

Category: Corporate Policies/Benefits

Short Description: To raise submit request for mentees to allocate E-Wallet Amount to their wallet based on the Award/Appreciation they receive.

 

Variables:

1. Requested By – Read-only, Auto populated by logged in user.

2. Requested For – Show only the users whose manager is logged in user.

3. Type of Award/Appreciation – Choice Values:

  1. Pat on the Back Award (Rs. 300)
  2. On-Spot Award (Rs.400)
  3. Best Employee of the month (Rs. 500)
  4. Successful Go-Live Appreciation (Rs. 250)
  5. Escalation Handling Appreciation (Rs.200)
  6. Best Newcomer Award (Rs. 600)
  7. Rising Star Award (Rs. 800)
  8. Extraordinary Employee Award (Rs. 1000)

4. E-Wallet Amount to be added - Based on Type selected, auto populate the amount linked to it.

 

5. Watchlist – List of users who can be added like Senior Manager, Delivery Head, Account Manager, etc.

 

6. Additional Comment – Multi line string text field.

 

7. Attachment – Attachment to show any proof. [Optional].

 

*****************************************************************************************************************

Join nowGurukul Communication Channels to get latest updates:-

LinkedIn:- https://www.linkedin.com/company/nowgurukul

What's App:- https://chat.whatsapp.com/DlXPEZCFFTn0ImvGA5UErP

YouTube:- https://www.youtube.com/channel/UClnJHTVq8kNkS1KCzMptYGg

 

Please Bookmark this Article 🔖 for your future reference and do Mark it as Helpful 👍 if you really enjoy working on this challenge.

 

Regards,

nowGurukul Team

 

Comments
Bphan
Tera Contributor

Hi @nowGurukul, Can you help me explain this better "1. Project/Account – Read-Only. Auto-populate based on Requested By from Employee record."

Sivasangeethp
Tera Contributor

@nowGurukul - In Application & Module I could see for some module visibility is only for "HR Agents" what it is? role or something.

AnubhavRitolia
Mega Sage
Mega Sage

@Bphan 

 

I am assuming you have completed Week 1 challenge.

 

Here you have to create a variable 'Project/Account' which should be read-only and it should auto populated based on the user you select in Requested By variable from the 'Employee' Table record where each employee is linked to Project/Account field.

 

AnubhavRitolia
Mega Sage
Mega Sage

Hi @Sivasangeethp 

 

I am assuming you have completed Week 1 challenge.

 

Here 'HR Agents' means HR agents who would be assigned to respective Requests. Who are part of HR Groups.

 

You have to figure out how you want to achieve it. 

Sivasangeethp
Tera Contributor

@AnubhavRitolia  - Yep i think i have got. please guide is this right or wrong

 

Sivasangeethp_0-1704720404562.png

Users who are part of above groups are HR Agents . So in module we can give visibility based on the roles only as per i know.

Sivasangeethp_1-1704720526471.png

So, i have planned to create one role called "HR_Agents" and will be assigning to above groups and afterwards i will assign the same role to module's visibility. so that it will only be visible to hr agents.

 

Kindly correct me if the idea is not correct.

Sivasangeethp
Tera Contributor

Hi All,

 

This is for people who got stuck at auto populate of "Project/Account" field. And for few of us value is not getting auto populate. 

At first i have tried with onload client script with glide record were i will get the "requested by" and will search for the user in employee table and from their i tried to get "Project/Account". But the value is not populating. As far i know the issue is coming because of the scope.

 

So i have created a glide Ajax and script include. And finally got the value.

Sample script:

client script:

Sivasangeethp_0-1704721654849.png

Script include:

Sivasangeethp_1-1704721723631.png

output:

 

Sivasangeethp_3-1704721780666.png

 

Sivasangeethp_2-1704721752621.png

 

Source Script

Client script :

function onLoad() {
   //Type appropriate comment here, and begin script below
  var user=g_form.getValue('u_requested_by');
 
  var ga = new GlideAjax('ProjectAccount');
  ga.addParam('sysparm_name', 'callback');
  ga.addParam('sysparm_user', user);
  ga.getXML(getDetails);

function getDetails(response) {
  var answer = response.responseXML.documentElement.getAttribute('answer');
  g_form.setValue('u_project_account',answer);
}
}
script include:
var ProjectAccount = Class.create();
ProjectAccount.prototype = Object.extendsObject(global.AbstractAjaxProcessor, {
    callback: function() {
        var user = this.getParameter('sysparm_user');
        var gr = new GlideRecord('x_906853_corpora_0_employee');
        gr.addQuery('sys_id', user);
        gr.query();
        gs.debug('E-voucher ='+gr.getRowCount);
        if (gr.next()) {
            return gr.project_account;
        }
    },

    type: 'ProjectAccount'
});
 
If it's useful for you. Mark it's as helpful.

 

 

Community Alums
Not applicable

If we are doing glide Ajax in week 2, imagine what we'll be doing in week 52.😂🤣

Afsar2
Tera Contributor

 

For Catalog item I see there is a variable set needs to be create. But it has only one variable mentioned. (Requested By).

Also, Variable set name is not defined in the problem statement.

 

Any suggestions please!

 

Afsar2_0-1704725005484.png

 

AnubhavRitolia
Mega Sage
Mega Sage

@Afsar2 

 

Yes you are free to use any variable set name as it is backend part and not required to be displayed on catalog item Form level.

Bphan
Tera Contributor

@nowGurukul 

I have Completed Hands-On Challenge W2

  1. Application Menu/Modules:

Bphan_68-1704786402075.png

 

Bphan_69-1704786402080.png

- All Employees – List of Employee Table all records.

Bphan_70-1704786402083.png

- My Employees – List of employees whose manager is Me (logged in user).

Bphan_71-1704786402086.png

- Create New Employee – New form to create Employee record

Bphan_72-1704786402089.png

- My Requests – List of E-Wallet Request requested by Me (logged in user).

Bphan_73-1704786402092.png

- Requests assigned to Me - List of E-Wallet Request assigned to me (logged in user). This module should be visible only to HR Agents

Bphan_74-1704786402095.png

 

Bphan_75-1704786402097.png

- Requests assigned to My Group - List of E-Wallet Request assigned to my Groups. This module should be visible only to HR Agents.

Bphan_76-1704786402101.png

 

Bphan_77-1704786402103.png

- Closed E-Wallet Requests – Available to only HR Agents. List of E-Wallet Requests which are closed.

Bphan_80-1704786453915.png

 

Bphan_81-1704786453918.png

2. Catalog Items:

Bphan_82-1704786487350.png

 

E-Voucher Brand Visible follow E-Voucher Type:

Bphan_83-1704786487353.png

 

Bphan_84-1704786487357.png

 

Bphan_85-1704786487360.png

 

Bphan_86-1704786487364.png

 

E-Voucher Amount Visible follow E-Voucher Type and E-voucher Price Auto-populate:

 

Bphan_87-1704786487367.png

 

Bphan_88-1704786487371.png

 

Bphan_89-1704786487374.png

 

Bphan_90-1704786487379.png

 

Quantity Choice:

Bphan_91-1704786509859.png

3. Record Producer:

Bphan_92-1704786529820.png

 

Requested For – Show only the users whose manager is logged in user:

Bphan_93-1704786529824.png

 

Bphan_94-1704786529831.png

 

Type of Award/Appreciation – Choice Values:

Bphan_95-1704786529836.png

 

E-Wallet Amount to be added - Based on Type selected, auto populate the amount linked to it.

Bphan_96-1704786529840.png

 

Bphan_97-1704786529843.png

 

 

 

Thanks, and best regards,

Bach Phan

Sivasangeethp
Tera Contributor

Hi @nowGurukul 

 

Challenge 2 is completed

 

Application Menu/Modules:

 

Sivasangeethp_42-1704801081276.png

 

 

  1. All Employees – List of Employee Table all records.

Sivasangeethp_43-1704801081282.png

 

Sivasangeethp_44-1704801081289.png

2. My Employees – List of employees whose manager is Me (logged in user).

Sivasangeethp_45-1704801081294.png

 

Sivasangeethp_46-1704801081302.png

3. Create New Employee – New form to create Employee record.

Sivasangeethp_47-1704801117960.png

 

Sivasangeethp_48-1704801117968.png

4. My Requests – List of E-Wallet Request requested by Me (logged in user).

Sivasangeethp_49-1704801117972.png

 

Sivasangeethp_50-1704801117979.png

 

 

For HR Agents visibility I have created role and tag the bellow the group and those group members are hr agents.

Sivasangeethp_51-1704801117989.png

 

Sivasangeethp_52-1704801118000.png

5. Requests assigned to Me - List of E-Wallet Request assigned to me (logged in user). This module should be visible only to HR Agents

Sivasangeethp_53-1704801282064.png

 

Sivasangeethp_54-1704801282070.png

6. Requests assigned to My Group - List of E-Wallet Request assigned to my Groups. This module should be visible only to HR Agents.

Sivasangeethp_55-1704801282074.png

 

Sivasangeethp_56-1704801282080.png

7. Closed E-Wallet Requests – Available to only HR Agents. List of E-Wallet Requests which are closed.

Sivasangeethp_57-1704801282083.png

 

Sivasangeethp_58-1704801282088.png

Catalog Items:

Name: E-Voucher Request

Sivasangeethp_59-1704801382689.png

 

E-Voucher Brand visibility based on  E-Voucher Type

1. E-Commerce 

Sivasangeethp_60-1704801382692.png

2.Shopping

Sivasangeethp_61-1704801382694.png

3.Sports Wear

Sivasangeethp_62-1704801382696.png

4. Food Delivery

Sivasangeethp_63-1704801382698.png

 

 

E-Voucher Amount visibility based on  E-Voucher Type

  1. E-Commerce

Sivasangeethp_64-1704801382700.png

2. Shopping

Sivasangeethp_65-1704801382703.png

3. Sports Wear

Sivasangeethp_66-1704801382705.png

4. Food Delivery

Sivasangeethp_67-1704801382708.png

E-Voucher Price: Read-Only and Auto-populate based on E-Voucher Amount and Quantity. (E-Voucher Amount*Price).

Sivasangeethp_68-1704801535074.png

 

Sivasangeethp_69-1704801535076.png

 

Sivasangeethp_70-1704801535081.png

 

Record Producer:

 

Name: Raise E-Wallet Request for your Mentee

Sivasangeethp_71-1704801580833.png

 

  1. Requested For – Show only the users whose manager is logged in user.

Logged in User : Siva S

Sivasangeethp_72-1704801580839.png

 

Sivasangeethp_73-1704801580842.png

 

 E-Wallet Amount to be added - Based on Type selected, auto populate the amount linked to it.

Pat on the Back Award (Rs. 300)

Sivasangeethp_74-1704801580845.png

On-Spot Award (Rs.400)

Sivasangeethp_75-1704801580847.png

Best Employee of the month (Rs. 500)

Sivasangeethp_76-1704801580849.png

Successful Go-Live Appreciation (Rs. 250)

Sivasangeethp_77-1704801580852.png

Escalation Handling Appreciation (Rs.200)

Sivasangeethp_78-1704801580854.png

Best Newcomer Award (Rs. 600)

Sivasangeethp_79-1704801672914.png

Rising Star Award (Rs. 800)

Sivasangeethp_80-1704801672917.png

Extraordinary Employee Award (Rs. 1000)

Sivasangeethp_81-1704801672919.png

 

Watchlist – List of users who can be added like Senior Manager, Delivery Head, Account Manager, etc.

Sivasangeethp_82-1704801672922.png

 

Sivasangeethp_83-1704801672927.png

 

 

Thanks,

Siva

Abhishek_Thakur
Mega Sage

Hi @AnubhavRitolia ,

 

Could you please help here to configure this.

3. E-Voucher Brand: Choice Values with None option:

  1. Flipkart (Visible only when E-Voucher Type is E-Commerce)
  2. Amazon (Visible only when E-Voucher Type is E-Commerce)
  3. Myntra (Visible only when E-Voucher Type is E-Commerce)
  4. Lifestyle (Visible only when E-Voucher Type is Shopping)
  5. Allen Solly (Visible only when E-Voucher Type is Shopping)
  6. Zomato (Visible only when E-Voucher Type is Food Delivery)
  7. Swiggy (Visible only when E-Voucher Type is Food Delivery)
  8. Puma (Visible only when E-Voucher Type is Sports Wear)
  9. Adidas (Visible only when E-Voucher Type is Sports Wear)
  10. Nike (Visible only when E-Voucher Type is Sports Wear)

I have tried to do it with client script, but I am not able to configure the visibility base on E-vouvher type. Could you please guide what I can use here to configure this requirement?

azharsheikh
Tera Contributor

Hi, @Sivasangeethp 
could you please upload your solution of week1 and week2 on youtube?
it would be great help

Abhishek_Thakur
Mega Sage

Hi Team,

 

Can anyone help here to configure the requested by field with auto populated value. My scripts is not working here.

Abhishek_Thakur
Mega Sage

Hi @nowGurukul ,

 

I have done with week 2 challenge.

Application Menu.pngE-Voucher Request.pngE-Wallet Request.png

Hp Saini
Tera Explorer

Screenshot 2024-01-11 at 12.20.47 PM.pngScreenshot 2024-01-11 at 12.19.41 PM.pngScreenshot 2024-01-11 at 12.17.45 PM.png

It was fun working on this week's challange. Thanks 🙏🤩

H562
Mega Guru

Hi @nowGurukul ,

 

Done with my week2 challenge.

 

AppMenu.pngE-VoucherRequest_NativeUI.pngE-VoucherRequest_PortalUI.pngRaiseE-wallet_NativeUI.pngRaiseE-wallet_PortalUI.png

 

Regards,

Harish Akurati

SarthakShri21
Tera Contributor

@Abhishek_Thakur 

Plz refer below script

SarthakShri21_0-1704977167629.png

And script:

function onChange(control, oldValue, newValue, isLoading) {
   if (isLoading || newValue == '') {
      return;
   }

   //Type appropriate comment here, and begin script below
   alert('SAR1');
   if (isLoading || newValue == '') {
   alert('SAR2');
        g_form.clearOptions('e_voucher_brand', '');
        return;
    }
    if (newValue == 'E-Commerce') {
        alert('SAR3');
        g_form.removeOption('e_voucher_brand', 'Lifestyle');
        g_form.removeOption('e_voucher_brand', 'Allen Solly');
        g_form.removeOption('e_voucher_brand', 'Zomato');
        g_form.removeOption('e_voucher_brand', 'Swiggy');
        g_form.removeOption('e_voucher_brand', 'Puma');
        g_form.removeOption('e_voucher_brand', 'Adidas');
        g_form.removeOption('e_voucher_brand', 'Nike');
        g_form.addOption('e_voucher_brand', 'Flipkart', 'Flipkart');
        g_form.addOption('e_voucher_brand', 'Amazon', 'Amazon');
        g_form.addOption('e_voucher_brand', 'Myntra', 'Myntra');

    }
   
    else if (newValue == 'Shopping') {
        alert('SAR4');
        g_form.removeOption('e_voucher_brand', 'Flipkart');
        g_form.removeOption('e_voucher_brand', 'Amazon');
        g_form.removeOption('e_voucher_brand', 'Myntra');
        g_form.removeOption('e_voucher_brand', 'Zomato');
        g_form.removeOption('e_voucher_brand', 'Swiggy');
        g_form.removeOption('e_voucher_brand', 'Puma');
        g_form.removeOption('e_voucher_brand', 'Adidas');
        g_form.removeOption('e_voucher_brand', 'Nike');
        g_form.addOption('e_voucher_brand', 'Lifestyle', 'Lifestyle');
        g_form.addOption('e_voucher_brand', 'Allen Solly', 'Allen Solly');

    }

    else if (newValue == 'Sports Wear') {
        alert('SAR5');
        g_form.removeOption('e_voucher_brand', 'Lifestyle');
        g_form.removeOption('e_voucher_brand', 'Allen Solly');
        g_form.removeOption('e_voucher_brand', 'Zomato');
        g_form.removeOption('e_voucher_brand', 'Swiggy');
        g_form.removeOption('e_voucher_brand', 'Flipkart');
        g_form.removeOption('e_voucher_brand', 'Amazon');
        g_form.removeOption('e_voucher_brand', 'Myntra');
        g_form.addOption('e_voucher_brand', 'Puma', 'Puma');
        g_form.addOption('e_voucher_brand', 'Adidas', 'Adidas');
        g_form.addOption('e_voucher_brand', 'Nike', 'Nike');
    }
   
    else if (newValue == 'Food Delivery') {
        alert('SAR6');
        g_form.removeOption('e_voucher_brand', 'Flipkart');
        g_form.removeOption('e_voucher_brand', 'Amazon');
        g_form.removeOption('e_voucher_brand', 'Myntra');
        g_form.removeOption('e_voucher_brand', 'Lifestyle');
        g_form.removeOption('e_voucher_brand', 'Allen Solly');
        g_form.removeOption('e_voucher_brand', 'Puma');
        g_form.removeOption('e_voucher_brand', 'Adidas');
        g_form.removeOption('e_voucher_brand', 'Nike');
        g_form.addOption('e_voucher_brand', 'Zomato', 'Zomato');
        g_form.addOption('e_voucher_brand', 'Swiggy', 'Swiggy');
    }
}
 
Make sure to modify the Values and labels of variables as per your configuration.
It will work....
 
Please mark helpful....
Himani_14
Mega Sage
Mega Sage

Hi @nowGurukul Team,

Please find screenshots below for week 2 challenge.

 

Application Menu/Modules:

Employee View

 

Himani5_0-1705235398623.png

 

HR View

Himani5_1-1705235530764.png

 

Catalog Items:

Name: E-Voucher Request

 

Himani5_2-1705236167958.png

 

Record Producer:

 

Name: Raise E-Wallet Request for your Mentee

Himani5_3-1705236285681.png

 

Thanks

Himani

 

 

 

Chetna_dev
Kilo Sage

Hii @nowGurukul  I have completed my 2nd Challenge, below are the screenshots.

Week 2 Challenge: 

Application Menu/Modules:

Screenshot (63).png

All Employees – List of Employee Table all records.

Screenshot (64).png

 

My Employees – List of employees whose manager is Me (logged in user).

Screenshot (65).png

 

Create New Employee – New form to create Employee record.

Screenshot (66).png

 

My Requests – List of E-Wallet Request requested by Me (logged in user).

Screenshot (67).png

 

HR Agent Role with group and modules

Screenshot (68).pngScreenshot (69).png

 

Requests assigned to Me - List of E-Wallet Request assigned to me (logged in user). This module should be visible only to HR Agents

Screenshot (70).pngScreenshot (71).png

 

 Requests assigned to My Group - List of E-Wallet Request assigned to my Groups. This module should be visible only to HR Agents.

Screenshot (72).pngScreenshot (73).png

 

Closed E-Wallet Requests – Available to only HR Agents. List of E-Wallet Requests which are closed

Screenshot (74).pngScreenshot (75).png

 

Catalog Items:

Name: E-Voucher Request

Screenshot (76).png

 

E-Voucher brand visibility based on E-Voucher Type

-Sports wear

Screenshot (77).png

-Food Delivery

Screenshot (80).png

Screenshot (81).png

E-Voucher Amount visibility based on  E-Voucher Type

Screenshot (78).png

 

E-Voucher Price: Read-Only and Auto-populate based on E-Voucher Amount and Quantity.

Screenshot (79).png

Screenshot (82).png

 

Record Producer:

Name: Raise E-Wallet Request for your Mentee

Screenshot (91).png

Requested For – Show only the users whose manager is logged in user.

Logged in User: Chetna Sharma

Screenshot (84).pngScreenshot (85).png

 

E-Wallet Amount to be added - Based on Type selected, auto populate the amount linked to it.

Screenshot (86).png

 

Watchlist 

Screenshot (89).png

 

My LinkedIn profile link: Chetna Sharma | LinkedIn

best

Chetna

 

 

Himani_14
Mega Sage
Mega Sage

Hi @nowGurukul Team,

Please find Week 2 challenge completion screenshots below.

 

Application Menu/Modules:

1. Employee View

Himani5_1-1705244956894.png

 

2. HR View

Himani5_2-1705245020928.png

 

Catalog Items:

Name: E-Voucher Request

 

Himani5_3-1705245308515.pngHimani5_4-1705245378453.pngHimani5_5-1705245457503.png

 

Record Producer:

 

Name: Raise E-Wallet Request for your Mentee

 

Himani5_6-1705245630035.pngHimani5_7-1705245673108.png

 

Thanks

Himani

 

jindal
Tera Explorer

Can anyone please help me in this field E-Voucher Price: Read-Only and Auto-populate based on E-Voucher Amount and Quantity? (E-Voucher Amount*Price)

dgarad
Giga Sage

Hi @nowGurukul 

I have done with the week 2 challenge.

Application Menu/Modules:

DharmarajGarad_0-1705310390436.png

 

DharmarajGarad_1-1705310466883.png

All Employees – List of Employee Table all records.

DharmarajGarad_2-1705310863016.png

 

My Employees – List of employees whose manager is Me (logged in user).

DharmarajGarad_3-1705310968108.png

 

Create New Employee – New form to create Employee record.

DharmarajGarad_4-1705311043808.png

 

My Requests – List of E-Wallet Request requested by Me (logged in user).

DharmarajGarad_5-1705311111533.png

 

Requests assigned to Me - List of E-Wallet Request assigned to me (logged in user). This module should be visible only to HR Agents

DharmarajGarad_6-1705311173124.png

 

Requests assigned to My Group - List of E-Wallet Request assigned to my Groups. This module should be visible only to HR Agents.

DharmarajGarad_7-1705311253750.png

 

Closed E-Wallet Requests – Available to only HR Agents. List of E-Wallet Requests which are closed

DharmarajGarad_8-1705311359505.png

Catalog Items:

Name: E-Voucher Request

DharmarajGarad_9-1705311479064.png

 

DharmarajGarad_16-1705312329606.png

 

E-Voucher Type - Choice Values-

  1. E-Commerce (Default)

DharmarajGarad_10-1705311716567.png

2. Shopping

DharmarajGarad_11-1705311819081.png

3. Sports Wear

DharmarajGarad_12-1705311906758.png

4. Food Delivery

DharmarajGarad_13-1705312029775.png

E-Voucher Amount:

DharmarajGarad_14-1705312182002.png

Record Producer:

Name: Raise E-Wallet Request for your Mentee

DharmarajGarad_17-1705312459484.png

 

DharmarajGarad_18-1705312532784.png

Requested For – Show only the users whose manager is logged in user.

DharmarajGarad_19-1705312747544.png

DharmarajGarad_0-1705313263049.png

 

E-Wallet Amount to be added - Based on Type selected, auto populate the amount linked to it.

DharmarajGarad_1-1705313330479.png

Watchlist 

DharmarajGarad_2-1705313365715.png

 

Regards,

Dharmaraj

 

Hakeem2
Tera Contributor

Thanks for this opportunity. I am learning a lot. I really appreciate the support being rendered by everyone.

 

E- Voucher.JPGRaise for Mentee1.JPG

Rampriya-S
Tera Guru
Tera Guru

Grateful appreciation to the @nowGurukul team for organizing the Week 2 challenge.

YouTube - https://youtu.be/D-cDF7MtoNk

Linked In -https://www.linkedin.com/posts/rampriya-s_corporate-gifting-week2-servicenow-challenge-activity-715284484691...

Abhilash
Tera Contributor

Can some one help on how to achieve this - 

4. E-Wallet Amount to be added - Based on Type selected, auto populate the amount linked to it.

jagadevi2010
Tera Contributor

jagadevi2010_0-1705401770170.png

E-Wallet Amount to be added - Based on Type selected, auto populate the amount linked to it.

 

jagadevi2010
Tera Contributor

Can someone pls help on this 

E-Voucher Price: Read-Only and Auto-populate based on E-Voucher Amount and Quantity. (E-Voucher Amount*Price).

SarthakShri21
Tera Contributor

@jagadevi2010 

You will have to write two onchange client script, one for 'E-Voucher Amount' variable and one for 'Quantity' variable, calculate the amount (Product of E-Voucher Amount and Quantity and set it in the 'E-Voucher Amount Price' variable.

Please refer below script. You will have to write similar one.

 

SarthakShri21_0-1705408875193.png

Client Script:

function onChange(control, oldValue, newValue, isLoading) {
   if (isLoading || newValue == '') {
      return;
   }

   //Type appropriate comment here, and begin script below
   
   var a= g_form.getValue('e_voucher_amount');
   alert(a);
   var b = parseInt(a);

   var c= g_form.getValue('quantity');
   alert(c);
   var d = parseInt(c);
 
   var mult = b*d;
   alert(mult);

   g_form.setValue('e_voucher_price', mult.toString());
   
}
 
 
Kindly mark the post helpful.
Thanks
vicky27
Tera Contributor

Hi All , 

Can anyone help , how we can populate "requested For" variable when Manager logged in and push the Group members to the choice ???

Thanks in advance.

Abhilash
Tera Contributor

@vicky27, you can add a simple reference qualifier to you requested for variable(which i believe is reference from user table).

 

manager.name is javascript:gs.getUserDisplayName()

 

Which would help you to display user's who manager is logged in user

dgarad
Giga Sage

Hi @vicky27 

Please refer to the screenshot.

DharmarajGarad_0-1705467080836.png

 

Mohan raj
Mega Sage

Hi @nowGurukul,

I have successfully completed week 2 challenge and screenshot are attached below.

Modules:

Mohanraj_0-1705483318121.png

 

Catalog item

Mohanraj_1-1705483318134.png

 

 

Mohanraj_2-1705483318144.png

 

Mohanraj_3-1705483318147.png

 

Mohanraj_4-1705483318150.png

 

Mohanraj_5-1705483318153.png

 

Mohanraj_6-1705483318156.png

 

Mohanraj_7-1705483318159.png

 

Mohanraj_8-1705483318163.png

 

Mohanraj_9-1705483318166.png

 

 

 

 

Record Producer

Mohanraj_12-1705483336353.png

 

Regards,

T Mohan.

Sivasangeethp
Tera Contributor

 

Hi @SarthakShri21 

 

Please check

 

Raise E-Wallet Request for your Mentee

Client script :

 

  1. Appreciation amount setting

Sivasangeethp_0-1705666225397.png

 

 

function onChange(control, oldValue, newValue, isLoading) {

    if (isLoading || newValue == '') {

        amountSetting(newValue);

    }

 

    amountSetting(newValue);

}

function amountSetting(newValue){

 

if (newValue == 'Pat on the Back Award') {

    g_form.setValue('u_e_wallet_amount_to_be_added', 'Rs. 300');

}

if (newValue == 'On-Spot Award') {

    g_form.setValue('u_e_wallet_amount_to_be_added', 'Rs. 400');

}

if (newValue == 'Best Employee of the month') {

    g_form.setValue('u_e_wallet_amount_to_be_added', 'Rs. 500');

}

if (newValue == 'Successful Go-Live Appreciation') {

    g_form.setValue('u_e_wallet_amount_to_be_added', 'Rs. 250');

}

if (newValue == 'Escalation Handling Appreciation') {

    g_form.setValue('u_e_wallet_amount_to_be_added', 'Rs. 200');

}

if (newValue == 'Best Newcomer Award') {

    g_form.setValue('u_e_wallet_amount_to_be_added', 'Rs. 600');

}

if (newValue == 'Rising Star Award') {

    g_form.setValue('u_e_wallet_amount_to_be_added', 'Rs. 800');

}

if (newValue == 'Extraordinary Employee Award') {

    g_form.setValue('u_e_wallet_amount_to_be_added', 'Rs. 1000');

}

 

//Type appropriate comment here, and begin script below

 

}

 

 

E-Voucher Request

 

Client script:

 

  1. E-Voucher Amount options visibility

Sivasangeethp_1-1705666225403.png

 

function onChange(control, oldValue, newValue, isLoading) {

    if (isLoading || newValue == '') {

        getVouchertype();

    }

    g_form.clearValue('u_e_voucher_amount');

    getVouchertype();

 

}

 

function getVouchertype() {

 

    g_form.clearOptions('u_e_voucher_amount');

 

    // 100

    if (newValue == 'Food Delivery') {

        g_form.addOption('u_e_voucher_amount', '100', '100', 1);

 

    } else {

        g_form.removeOption('u_e_voucher_amount', '100');

 

    }

    //200

    if (newValue == 'Food Delivery' || newValue == 'E-Commerce') {

        g_form.addOption('u_e_voucher_amount', '200', '200', 2);

 

    } else {

        g_form.removeOption('u_e_voucher_amount', '200');

 

    }

 

    // 250

    if (newValue == 'Sports Wear' || newValue == 'E-Commerce') {

        g_form.addOption('u_e_voucher_amount', '250', '250', 3);

    } else {

        g_form.removeOption('u_e_voucher_amount', '250');

 

    }

    //400

    if (newValue == 'Shopping' || newValue == 'Food Delivery') {

        g_form.addOption('u_e_voucher_amount', '400', '400', 4);

    } else {

        g_form.removeOption('u_e_voucher_amount', '400');

 

    }

    //500

    if (newValue == 'Sports Wear' || newValue == 'E-Commerce' || newValue == 'Shopping') {

        g_form.addOption('u_e_voucher_amount', '500', '500', 5);

    } else {

        g_form.removeOption('u_e_voucher_amount', '500');

 

    }

    // 750

    if (newValue == 'Sports Wear' || newValue == 'Shopping') {

        g_form.addOption('u_e_voucher_amount', '750', '750', 6);

    } else {

        g_form.removeOption('u_e_voucher_amount', '750');

 

    }

    //1000

    if (newValue == 'Sports Wear' || newValue == 'Shopping' || newValue == 'E-Commerce' || newValue == 'Food Delivery') {

        g_form.addOption('u_e_voucher_amount', '1000', '1000', 7);

    } else {

        g_form.removeOption('u_e_voucher_amount', '1000');

 

    }

    //Type appropriate comment here, and begin script below

 

}

 

  1. E-Voucher Price calc:

Sivasangeethp_2-1705666225411.png

 

function onChange(control, oldValue, newValue, isLoading) {

   if (isLoading || newValue == '') {

      return;

   }

   var Quantity=newValue;

   var amount=g_form.getValue('u_e_voucher_amount');

   var price=amount*Quantity;

   g_form.setValue('u_e_voucher_price',price);

 

   //Type appropriate comment here, and begin script below

   

}

 

  1. E-Voucher Brand options visibility:

Sivasangeethp_3-1705666225417.png

 

function onChange(control, oldValue, newValue, isLoading) {

    if (isLoading || newValue == '') {

        getVouchertype();

    }

    g_form.clearValue('u_e_voucher_brand');

    getVouchertype();

 

}

//E-Commerce

function getVouchertype() {

    // g_form.clearOptions('u_e_voucher_brand');

 

    if (newValue == 'E-Commerce') {

        g_form.addOption('u_e_voucher_brand', 'Flipkart', 'Flipkart', 1);

        g_form.addOption('u_e_voucher_brand', 'Amazon', 'Amazon', 2);

        g_form.addOption('u_e_voucher_brand', 'Myntra', 'Myntra', 3);

 

    } else {

        g_form.removeOption('u_e_voucher_brand', 'Flipkart');

        g_form.removeOption('u_e_voucher_brand', 'Amazon');

        g_form.removeOption('u_e_voucher_brand', 'Myntra');

    }

    //Shopping

    if (newValue == 'Shopping') {

        g_form.addOption('u_e_voucher_brand', 'Lifestyle', 'Lifestyle', 1);

        g_form.addOption('u_e_voucher_brand', 'Allen Solly', 'Allen Solly', 2);

    } else {

        g_form.removeOption('u_e_voucher_brand', 'Lifestyle');

        g_form.removeOption('u_e_voucher_brand', 'Allen Solly');

 

    }

    // Food Delivery

    if (newValue == 'Food Delivery') {

        g_form.addOption('u_e_voucher_brand', 'Zomato', 'Zomato', 1);

        g_form.addOption('u_e_voucher_brand', 'Swiggy', 'Swiggy', 2);

 

    } else {

        g_form.removeOption('u_e_voucher_brand', 'Zomato');

        g_form.removeOption('u_e_voucher_brand', 'Swiggy');

 

    }

 

    // Sports Wear

    if (newValue == 'Sports Wear') {

        g_form.addOption('u_e_voucher_brand', 'Puma', 'Puma', 1);

        g_form.addOption('u_e_voucher_brand', 'Adidas', 'Adidas', 2);

        g_form.addOption('u_e_voucher_brand', 'Nike', 'Nike', 3);

    } else {

        g_form.removeOption('u_e_voucher_brand', 'Puma');

        g_form.removeOption('u_e_voucher_brand', 'Adidas');

        g_form.removeOption('u_e_voucher_brand', 'Nike');

    }

 

    //Type appropriate comment here, and begin script below

 

}

 

  1. E-Voucher Price calc:

Sivasangeethp_4-1705666225423.png

 

function onChange(control, oldValue, newValue, isLoading) {

   if (isLoading || newValue == '') {

      return;

   }

   var Quantity=g_form.getValue('u_quantity');

   var amount=newValue;

   var price=amount*Quantity;

   g_form.setValue('u_e_voucher_price',price);

 

   //Type appropriate comment here, and begin script below

   

}

 

 

 

SunilKumar_P
Giga Sage

Hello @nowGurukul,

 

I have completed #Week_2 challenege:

 

Application Menu/Modules:

SunilKumar_P_0-1705677533667.png

 

All Employees - List of Employee Table all records.

SunilKumar_P_1-1705677680328.png

 

My Employees – List of employees whose manager is Me (logged in user).

SunilKumar_P_2-1705677754279.png

 

Create New Employee - New form to create Employee record.

SunilKumar_P_3-1705677804335.png

 

My Requests - List of E-Wallet Request requested by Me (logged in user).

SunilKumar_P_4-1705677840117.png

 

Requests Assigned to Me: List of E-Wallet Request assigned to me (logged in user). This module should be visible only to HR Agents.

SunilKumar_P_5-1705677886229.png

 

Requests Assigned to My Group: List of E-Wallet Request assigned to my Groups. This module should be visible only to HR Agents.

SunilKumar_P_6-1705677927536.png

 

Closed E-Wallet Request: Available to only HR Agents. List of E-Wallet Requests which are closed.

SunilKumar_P_7-1705677970412.png

 

Catalog Item: E-Voucher Request:

SunilKumar_P_8-1705678943879.png

 

E-Voucher Type: E-Commerce:

SunilKumar_P_9-1705679068793.png

 

E-Voucher Type: Shopping:

SunilKumar_P_10-1705679104532.png

 

E-Voucher Type: Food Delivery

SunilKumar_P_11-1705679136130.png

 

E-Voucher Amount:

SunilKumar_P_12-1705679376055.png

 

SunilKumar_P_13-1705679402961.png

 

Quantity:

SunilKumar_P_14-1705679439819.png

 

 

Record Producer: Raise E-Wallet Request for your Mentee

 

SunilKumar_P_15-1705679495345.png

 

Type of Award:

SunilKumar_P_16-1705679514101.png

 

E-Wallet Amount:

SunilKumar_P_17-1705679550158.pngSunilKumar_P_18-1705679567841.png

Watch List:

SunilKumar_P_19-1705679586385.png

 

Regards,

Sunil

 

 

 

Khan Ejaz
Tera Contributor
Code for value depending on E - Voucher Type :
 
 
function onChange(control, oldValue, newValue, isLoading) {
    if (isLoading || newValue == '') {
        g_form.clearOptions('u_e_voucher_brand');
        g_form.addOption('u_e_voucher_brand', 'u_flip', 'Flipkart', '1');
        g_form.addOption('u_e_voucher_brand', 'u_amazon', 'Amazon', '2');
        g_form.addOption('u_e_voucher_brand', 'u_myntra', 'Myntra', '3');
        g_form.clearOptions('u_e_voucher_amount');
        g_form.addOption('u_e_voucher_amount', '200', '200', '1');
        g_form.addOption('u_e_voucher_amount', '250', '250', '2');
        g_form.addOption('u_e_voucher_amount', '500', '500', '3');
        g_form.addOption('u_e_voucher_amount', '1000', '1000', '4');
        return;
    }
    if (newValue == 'u_e_commerce') {
        g_form.clearOptions('u_e_voucher_brand');
        g_form.addOption('u_e_voucher_brand', 'u_flip', 'Flipkart', '1');
        g_form.addOption('u_e_voucher_brand', 'u_amazon', 'Amazon', '2');
        g_form.addOption('u_e_voucher_brand', 'u_myntra', 'Myntra', '3');
        g_form.clearOptions('u_e_voucher_amount');
        g_form.addOption('u_e_voucher_amount', '200', '200', '1');
        g_form.addOption('u_e_voucher_amount', '250', '250', '2');
        g_form.addOption('u_e_voucher_amount', '500', '500', '3');
        g_form.addOption('u_e_voucher_amount', '1000', '1000', '4');

    } else if (newValue == 'u_shopping') {
        g_form.clearOptions('u_e_voucher_brand');
        g_form.addOption('u_e_voucher_brand', 'u_lifestyle', 'Lifestyle', '1');
        g_form.addOption('u_e_voucher_brand', 'u_allen', 'Allen Solly', '2');
        g_form.clearOptions('u_e_voucher_amount');
        g_form.addOption('u_e_voucher_amount', '250', '250', '1');
        g_form.addOption('u_e_voucher_amount', '400', '400', '2');
        g_form.addOption('u_e_voucher_amount', '500', '500', '3');
        g_form.addOption('u_e_voucher_amount', '1000', '1000', '4');


    } else if (newValue == 'u_food') {
        g_form.clearOptions('u_e_voucher_brand');
        g_form.addOption('u_e_voucher_brand', 'u_zomata', 'Zomato', '1');
        g_form.addOption('u_e_voucher_brand', 'u_swiggy', 'Swiggy', '2');
        g_form.clearOptions('u_e_voucher_amount');
        g_form.addOption('u_e_voucher_amount', '100', '100', '1');
        g_form.addOption('u_e_voucher_amount', '200', '200', '2');
        g_form.addOption('u_e_voucher_amount', '400', '400', '3');
        g_form.addOption('u_e_voucher_amount', '1000', '1000', '4');

    } else if (newValue == 'u_sports') {
        g_form.clearOptions('u_e_voucher_brand');
        g_form.addOption('u_e_voucher_brand', 'u_puma', 'Puma', '1');
        g_form.addOption('u_e_voucher_brand', 'u_addidas', 'Addidas', '2');
        g_form.addOption('u_e_voucher_brand', 'u_nike', 'Nike', '3');
        g_form.clearOptions('u_e_voucher_amount');
        g_form.addOption('u_e_voucher_amount', '250', '250', '1');
        g_form.addOption('u_e_voucher_amount', '500', '500', '2');
        g_form.addOption('u_e_voucher_amount', '750', '750', '3');
        g_form.addOption('u_e_voucher_amount', '1000', '1000', '4');
    }
}
Community Alums
Not applicable

Any suggestions on how to auto-populate these fields?

 

gueldonh_0-1707758507937.png

 

v1z-D
Tera Contributor

Hi @nowGurukul, Can you help me explain this better "1. Project/Account – Read-Only. Auto-populate based on Requested By from Employee record."
How to achieve this without having 'Requested By' field in the employee table?

I tried making required by field in the catalog as reference to employee table but not able to get project/account field values auto populate.
Appreciate if anyone can let me know how did you all achieve this from variable configuration.

Community Alums
Not applicable

Hi @v1z-D Please refer to the screenshots below

 

gueldonh_0-1708179208142.png

gueldonh_1-1708179220329.png

 

v1z-D
Tera Contributor

@Community Alums 

This is for auto populate project/account based on requested by ?

 

you got this just by doing dot walk to project/account? 
More details..

 

 I got this by client script and script include. I tried to without script but couldn’t get it.

if you got this without these scripts let me know how . I’m interested to know more 

 

Thank you for updating 

v1z-D
Tera Contributor

nowGurukul ServiceNow Hands-On Challenge 2024 #Week_2

 

 

 

Application Menu/Modules:

 

 

v1zD_0-1708463796514.png

 

Modules:

1.All Employees: List of Employee Table all records.

 

v1zD_1-1708463796532.png

v1zD_2-1708463796550.png

 

  1. My Employees – List of employees whose manager is Me (logged in user).

v1zD_3-1708463796565.png

 

v1zD_4-1708463796580.png

 

3.Create New Employee – New form to create Employee record.

v1zD_5-1708463796596.png

v1zD_6-1708463796607.png

  1. My Requests – List of E-Wallet Request requested by Me (logged in user).

v1zD_7-1708463796620.png

v1zD_8-1708463796646.png

 

  1. Requests assigned to Me - List of E-Wallet Request assigned to me (logged in user). This module should be visible only to HR Agents.

     

    1. v1zD_9-1708463796659.png

 

  1. Requests assigned to My Group - List of E-Wallet Request assigned to my Groups. This module should be visible only to HR Agents.

v1zD_28-1708464485715.png

v1zD_29-1708464501797.png

  1. Closed E-Wallet Requests – Available to only HR Agents. List of E-Wallet Requests which are closed.

v1zD_30-1708464527693.png

v1zD_31-1708464537482.png

Catalog Items:

Requested By – Read-only, Auto populated by logged in user.

v1zD_32-1708464554717.png

  1. Project/Account – Read-Only. Auto-populate based on Requested By from Employee record.

v1zD_33-1708464595727.png

  1. E-Voucher Type - Choice Values-
    v1zD_34-1708464607816.png

     

  2. E-Voucher Brand: Choice Values with None option:

v1zD_35-1708464617523.png

  1. E-Voucher Amount:

v1zD_36-1708464656056.png

  1. Quantity: Choice Values:

v1zD_37-1708464690042.png

 

  1. E-Voucher Price: Read-Only and Auto-populate based on E-Voucher Amount and Quantity. (E-Voucher Amount*Price).

v1zD_38-1708464714342.png 

Record ProducerRaise E-Wallet Request for your Mentee

v1zD_39-1708464737348.png

  1. Requested By – Read-only, Auto populated by logged in user.

v1zD_40-1708464760982.png

    2. Requested For – Show only the users whose manager is logged in user.

v1zD_41-1708464783438.png

  1. Type of Award/Appreciation – Choice Values:     

v1zD_42-1708464810982.png

  1. E-Wallet Amount to be added - Based on Type selected, auto populate the amount linked to it.    

v1zD_43-1708464843249.png

  1. Watchlist – List of users who can be added like Senior Manager, Delivery Head, Account Manager, etc.

v1zD_44-1708464880207.png



Thank You

 

 

Community Alums
Not applicable

Hi @v1z-D,

 

How did you add the watchlist button? 

Carlos Camacho
Mega Sage
Mega Sage

Hi, 
 Week 2 completed. Let's move forward! 

v1z-D
Tera Contributor

@Community Alums 

I added in watchlist variable - type specification- variable attributes - glide_list

Community Alums
Not applicable

To populate the project account on catalog item is not working, io am trying using GlideAjax.

 

Tannu_24_0-1711461851089.pngTannu_24_1-1711461875927.png

 

Please help me where i am going wrong.

 

Community Alums
Not applicable

Hi @nowGurukul,

 

Please help to autopopulate the below.

Project/Account – Read-Only. Auto-populate based on Requested By from Employee record.

 

Requested by refence to user table, and trying to autopopulate Project/Account by GlideAjax but it is not working.

 

 

dgarad
Giga Sage

Hi @Community Alums 

try the as per the below screen shot.

 

dgarad_0-1711544557666.png

 

Community Alums
Not applicable

Hi @dgarad,

 

Can you please confirm Requested By referring to sys_user or Employee table. Because when I have created the variable Requested By which refer to sys_user table, in this case in autopopulate referencece is taking the sys_user and i am enable to to change it as employee table.

dgarad
Giga Sage

Hi @Community Alums 

Requested By referring to Employee table.

AnimeshP_96
Tera Guru

Hello @nowGurukul

I have completed all the things for the week 2.Snapshots down below ,Let me know if anything is missed.

AnimeshP_96_0-1713873908795.png

 

AnimeshP_96_1-1713873968145.png

 

AnimeshP_96_2-1713874021354.png

 

AnimeshP_96_3-1713874051128.png

 

AnimeshP_96_4-1713874072814.png

 

AnimeshP_96_5-1713874133803.pngAnimeshP_96_6-1713874199374.png

 

AnimeshP_96_7-1713874210853.png

 

 

AnimeshP_96_8-1713874356989.png

 

AnimeshP_96_9-1713874389753.png

 

 

AnimeshP_96_10-1713874438408.png

 

AnimeshP_96_11-1713874493593.png

 

 

AnimeshP_96_12-1713874515122.png

 

 


 

Version history
Last update:
‎01-08-2024 02:10 AM
Updated by: