multi-row variable set データにスクリプトからアクセスする方法Issue <!-- /*NS Branding Styles*/ --> .ns-kb-css-body-editor-container { p { font-size: 12pt; font-family: Lato; color: #000000; } span { font-size: 12pt; font-family: Lato; color: #000000; } h2 { font-size: 24pt; font-family: Lato; color: black; } h3 { font-size: 18pt; font-family: Lato; color: black; } h4 { font-size: 14pt; font-family: Lato; color: black; } a { font-size: 12pt; font-family: Lato; color: #00718F; } a:hover { font-size: 12pt; color: #024F69; } a:target { font-size: 12pt; color: #032D42; } a:visited { font-size: 12pt; color: #00718f; } ul { font-size: 12pt; font-family: Lato; } li { font-size: 12pt; font-family: Lato; } img { display: ; max-width: ; width: ; height: ; } } ServiceNow でスクリプトから multi-row variable set データにアクセスする方法について説明します。要求されたアイテム (RITM) が送信されると、multi-row variable の値は Multi Row Question Answer [sc_multi_row_question_answer] テーブルに保存されます。 詳細については、Scriptable service catalog variables を参照してください。 Release<!-- /*NS Branding Styles*/ --> .ns-kb-css-body-editor-container { p { font-size: 12pt; font-family: Lato; color: #000000; } span { font-size: 12pt; font-family: Lato; color: #000000; } h2 { font-size: 24pt; font-family: Lato; color: black; } h3 { font-size: 18pt; font-family: Lato; color: black; } h4 { font-size: 14pt; font-family: Lato; color: black; } a { font-size: 12pt; font-family: Lato; color: #00718F; } a:hover { font-size: 12pt; color: #024F69; } a:target { font-size: 12pt; color: #032D42; } a:visited { font-size: 12pt; color: #00718f; } ul { font-size: 12pt; font-family: Lato; } li { font-size: 12pt; font-family: Lato; } img { display: ; max-width: ; width: ; height: ; } } London リリース以降 Resolution<!-- /*NS Branding Styles*/ --> .ns-kb-css-body-editor-container { p { font-size: 12pt; font-family: Lato; color: #000000; } span { font-size: 12pt; font-family: Lato; color: #000000; } h2 { font-size: 24pt; font-family: Lato; color: black; } h3 { font-size: 18pt; font-family: Lato; color: black; } h4 { font-size: 14pt; font-family: Lato; color: black; } a { font-size: 12pt; font-family: Lato; color: #00718F; } a:hover { font-size: 12pt; color: #024F69; } a:target { font-size: 12pt; color: #032D42; } a:visited { font-size: 12pt; color: #00718f; } ul { font-size: 12pt; font-family: Lato; } li { font-size: 12pt; font-family: Lato; } img { display: ; max-width: ; width: ; height: ; } } 構文リファレンス multi-row variable データにアクセスするには、次の構文を使用します。ここで、table_var は multi-row variable set の内部名です: gr.variables.table_var — JSON 配列値を文字列として返します。gr.variables.table_var.getRow(i) — multi-row variable から行 i を返します。gr.variables.table_var.getRowCount() — 現在の行数を返します。 例 次の例では、server_build_list という名前の multi-row variable を使用します。このフィールドは次のとおりです: u_data_center — Referenceu_how_many — Integeru_storage_size — Reference スクリプト var gr = new GlideRecord('sc_req_item'); if (gr.get('<SYS_ID OF RITM>')){// Syntax for this is gr.variables.table_var which returns JSON array value as Stringgs.log( "1.variables "+ gr.variables.server_build_list);}// Syntax for this is gr.variables.table_var.getRow(<ROW NUMBER [i]>) which returns ith row from the multi row variable// and we are trying to access a cell out of it as belowvar row = gr.variables.server_build_list.getRow('1');gs.log( "Fetching Row 1 "+ row.u_data_center);// Syntax for this is gr.variables.table_var.getRowCount( ) which returns current row countgs.log( "Row Count "+gr.variables.server_build_list.getRowCount()); 結果 *** Script: 1.variables [ { "u_data_center" : "a41d652bdb335b00af053b2ffe9619e0", "u_how_many" : "1","u_storage_size" : "1024" }, { "u_data_center" : "a41d652bdb335b00af053b2ffe9619e0", "u_how_many" : "4", "u_storage_size" : "2048" } ]*** Script: Fetching Row 1 a41d652bdb335b00af053b2ffe9619e0 *** Script: Row Count 2 Related Links<!-- /*NS Branding Styles*/ --> .ns-kb-css-body-editor-container { p { font-size: 12pt; font-family: Lato; color: #000000; } span { font-size: 12pt; font-family: Lato; color: #000000; } h2 { font-size: 24pt; font-family: Lato; color: black; } h3 { font-size: 18pt; font-family: Lato; color: black; } h4 { font-size: 14pt; font-family: Lato; color: black; } a { font-size: 12pt; font-family: Lato; color: #00718F; } a:hover { font-size: 12pt; color: #024F69; } a:target { font-size: 12pt; color: #032D42; } a:visited { font-size: 12pt; color: #00718f; } ul { font-size: 12pt; font-family: Lato; } li { font-size: 12pt; font-family: Lato; } img { display: ; max-width: ; width: ; height: ; } } Scriptable service catalog variablesMulti-row variable set list