Built something you're proud of? Tell the story. A quick G2 review of App Engine or Build Agent helps other developers see what's possible on ServiceNow. Share your experience.

Is there any way I can bring the Risk number in sn_risk_advanced_risk_assessment_instance

Senthil Kumar 1
Tera Contributor

sn_risk_advanced_risk_assessment_instance - This table contains Risk name but not Risk number

4 REPLIES 4

pr8172510
Giga Guru

Hi @senthil kumar,

You are correct — the table sn_risk_advanced_risk_assessment_instance does not store the Risk number directly. It mainly keeps a reference to the Risk record and some denormalized fields like Risk name.


🔹 How you can get the Risk number

The key point is:

This table has a reference field to the Risk record (typically risk)

So instead of expecting the number in this table, you should fetch it from the related Risk record.


🔹 Option 1: Dot-walking (recommended)

If you're using:

  • Reports
  • List layout
  • Scripts

You can simply use:

  • risk.number

Example:

  • In list/report → add column: Risk → Number
  • In script: gr.risk.number                                                      

    🔹 Option 2: Add a Dictionary field (if needed for reporting)

    If you want the number directly available:

    • Create a new field:
      • Type: String
      • Name: u_risk_number
    • Populate using:
      • Business Rule OR Flow Designer
      • Value: current.risk.number

    Useful if:

    • You need performance optimization
    • Heavy reporting / PA indicators

    🔹 Option 3: Database View (for advanced reporting)

    • Create a DB View between:
      • sn_risk_advanced_risk_assessment_instance
      • Risk table (sn_risk_risk)

    This helps if:

    • You want reporting without duplicating data

    🔹 Important Note

    • ServiceNow intentionally avoids duplicating fields like number in child tables
    • Instead, it relies on reference relationships (normalized design)

SohamTipnis
Mega Sage

Hi @Senthil Kumar 1,

 

Yes, it is possible; you just need to understand how the data is linked.

In the sn_risk_advanced_risk_assessment_instance table, the risk number is not stored directly. Instead, this table usually has a reference to the risk record (through a field like "risk"). The actual risk number lives in the risk table (field = number).

So, the easiest way to bring the risk number is by using dot walking. Wherever you are working (report, script, form), you can simply use risk.number to fetch it. This works because ServiceNow automatically follows the reference and pulls the value.

If your requirement is just to display it (like in reports or forms), dot-walking is enough and recommended. No need to create extra fields.

However, if you specifically need to store the risk number inside the assessment instance (for example, for export or performance reasons), then you can create a custom field and populate it using a business rule or Flow Designer by copying the value from risk.number.

 

In short, you don’t need to overcomplicate it; just use the reference and dot-walk unless there’s a strong reason to store it separately. 😉

 

Let me know if this helps!!!!😀

 

 

If you find my answer useful, please mark it as helpful and correct. ‌‌‌‌‌‌‌‌‌‌‌😊


Regards,
Soham Tipnis
ServiceNow Developer ||  Technical Consultant
LinkedIn: www.linkedin.com/in/sohamtipnis10

Anupama Singh1
Tera Guru

Hi @Senthil Kumar 1 
The Risk Number is not stored directly on sn_risk_advanced_risk_assessment_instance.
This table has a reference to the Risk record, so you can access the Risk Number by dot‑walking:
risk.number

This is the recommended and OOB approach.

 

If this solved your issue, kindly mark it as correct 👍and close the thread. This helps the community 😊.