SAM SaaS Integration Profile — How Default Fields Are Auto-Populated on New Profile CreationSummary<!-- /*NS Branding Styles*/ --> .ns-kb-css-body-editor-container { p { font-size: 12pt; font-family: Lato; color: var(--now-color--text-primary, #000000); } span { font-size: 12pt; font-family: Lato; color: var(--now-color--text-primary, #000000); } h2 { font-size: 24pt; font-family: Lato; color: var(--now-color--text-primary, black); } h3 { font-size: 18pt; font-family: Lato; color: var(--now-color--text-primary, black); } h4 { font-size: 14pt; font-family: Lato; color: var(--now-color--text-primary, black); } a { font-size: 12pt; font-family: Lato; color: var(--now-color--link-primary, #00718F); } a:hover { font-size: 12pt; color: var(--now-color--link-primary, #024F69); } a:target { font-size: 12pt; color: var(--now-color--link-primary, #032D42); } a:visited { font-size: 12pt; color: var(--now-color--link-primary, #00718f); } ul { font-size: 12pt; font-family: Lato; } li { font-size: 12pt; font-family: Lato; } img { display: ; max-width: ; width: ; height: ; } } When creating a new SAM SaaS integration profile on the samp_sw_subscription_profile table, certain fields such as Download Consumption Subflow, Download Subscription Subflow, Reclaim Subscription Subflow, Activity Subscription Subflow, and Connection Credential are automatically populated by the platform before the record is saved. This article explains the OOB mechanism behind this behavior and provides troubleshooting steps when the fields do not populate as expected. ─────────────────────────────────HOW IT WORKS The auto-population is driven by four components working in sequence every time the samp_sw_subscription_profile form loads for a new record. Step 1 — Display Business Rule: Set profile form config on scratchpadThis before_display business rule fires on form load and calls SAMSaasIntegrationUtils.getProfileFormConfig(), passing the profile_type of the current record. The result is stored in g_scratchpad.profile_form_config for client scripts to consume. Step 2 — sam_saas_script_route lookupInside getProfileFormConfig, a call is made to getIntegrationObject(profileType), which queries the sam_saas_script_route table for a row matching the current profile_type. This table maps each profile_type to a specific script include and scope. The matched script include is instantiated and its getProfileFormConfig() method is called. Note: sam_saas_script_route is scoped to sn_sam_saas and is not readable via the REST API due to cross-scope access restrictions. It can be queried server-side via a background script using GlideRecord. Step 3 — sam_saas_profile_type_default_value lookupThe instantiated script include queries the sam_saas_profile_type_default_value table for all rows where profile_type matches the current profile. Each row defines one field and its default value. The result is returned as an object with isValid set to true and a defaultValues array containing the field and value pairs, stored in g_scratchpad.profile_form_config. Step 4 — OnLoad Client Script: SAMSaas configure profile config defaultThis client script reads g_scratchpad.profile_form_config. When isValid is true and the record is new, it loops through the defaultValues array and calls g_form.setValue() for each entry, setting the default fields on the form before the user saves the record. ─────────────────────────────────TROUBLESHOOTING If default fields are not auto-populating when creating a new profile, work through the following checks in order. Check 1 — Verify the sam_saas_script_route entry exists for the profile type Run the following background script on the affected instance, replacing the profileType value with the affected profile type: var profileType = 'crowdstrike_subscription'; var gr = new GlideRecord('sam_saas_script_route'); gr.addQuery('profile_type', profileType); gr.query(); while (gr.next()) { gs.log('scope: ' + gr.getValue('scope'), 'SAM_DEBUG'); gs.log('script_include: ' + gr.getValue('script_include'), 'SAM_DEBUG'); } if (gr.getRowCount() == 0) { gs.log('NO entry found for ' + profileType, 'SAM_DEBUG'); } If no entry is found, the getIntegrationObject call will throw an error and getProfileFormConfig will return isValid as false. No default fields will be set. Compare with a reference instance on the same version and patch level and insert the missing row. Check 2 — Verify the sam_saas_profile_type_default_value rows exist for the profile type var profileType = 'crowdstrike_subscription'; var gr = new GlideRecord('sam_saas_profile_type_default_value'); gr.addQuery('profile_type', profileType); gr.query(); while (gr.next()) { gs.log('field: ' + gr.getValue('field') + ' | value: ' + gr.getValue('value'), 'SAM_DEBUG'); } if (gr.getRowCount() == 0) { gs.log('NO default value rows found for ' + profileType, 'SAM_DEBUG'); } If no rows are found, the defaultValues array returned to the client script will be empty and no fields will be set. Insert the missing rows by comparing with a reference instance on the same version and patch level. Check 3 — Verify the display BR and client script are active Confirm the following are active on samp_sw_subscription_profile:- Business Rule (before_display): Set profile form config on scratchpad- Client Script (onLoad): SAMSaas configure profile config default If either is inactive, g_scratchpad.profile_form_config will either not be set or not be consumed, and the fields will not populate. Check 4 — Verify the mapped script include implements getProfileFormConfig If Check 1 returns a valid entry but fields are still not populating, confirm the script include identified in sam_saas_script_route implements a getProfileFormConfig method. If the method does not exist, getProfileFormConfig in SAMSaasIntegrationUtils falls back to a default config object that contains no defaultValues, and no fields will be set. ─────────────────────────────────KEY TABLES - sam_saas_script_route — Maps each profile_type to its integration script include and scope- sam_saas_profile_type_default_value — Stores the default field values per profile_type- samp_sw_subscription_profile — The integration profile record