Excelファイルのassigned_toのnameの値をsys_idの値に変換したい
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-01-2023 02:31 AM
Excelファイルのassigned_toのnameの値をsys_idの値に変換したいんですが以下の流れで可能でしょうか。
1、ServicenowAPIを使用してsys_userテーブルにアクセスする
2、assigned_toの名前と一致するsys_userレコードを検索
3、もしあればsys_userレコードからsys_idを取得
4、Excelでassigned_toのnameの値に対して、sys_idを上書きする
文章でわかりづらいと思うので、簡単なチャートを作りました。画像を確認ください。
目的としては、同じ名前の人がいると、インポートした時どちらの人がレコードに挿入されるかわからないので、
インポートする前に被らないsys_idに変換しときたい。
最後に、
1、この流れが可能かどうか
2、もし可能なら助けていただけると嬉しいです。
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-01-2023 02:49 AM
May I ask are you're trying to export or import the data?
If it's the Export case, you can leverage the SNUtils which will help to pull out the Assigned to Sys ID field on the list. And you will be able to retrieve it.
Sample below.
Cheers,
Tai Vu
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-01-2023 06:40 PM - edited 11-01-2023 08:06 PM
@Tai Vu
さんメッセージありがとうございます!
■import data or export data
これはimport dataです。
ですので、assign_toのnameからsys_idに変換後、import sets でimportする予定です。
■SNUtills
SNUtillsというのをはじめて知りました。
実際に使ってみましたが、assiged_to.sys_IDをリストビューに表示することはできておりません。
手順を教えて頂けませんか?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-01-2023 08:16 PM
If you've interest about SNUtils, you can have a look to the below link.
SN Utils with Arnoud Kooi - Did You Know
There's an alternative as well, you can export as XML then just Open With Excel
Regarding Import data, you can control how a Reference field will map with your input from your Excel.
In the Transform Map you're using to load data, under related list Field Maps > open the field Assigned to > update the Referenced value field name to match with the value from the Excel file.
It can be Email [email], User ID [user_name], etc.
Cheers,
Tai Vu
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-01-2023 06:57 PM
APIでnameをsys_idに変換する際、同様な問題(同名な人がいる)でどのsys_idに変換するのか自動判定はできないと思って、結局は手動で判断したりする必要です。
name+αで一意的に人を特定できるなら、大丈夫ですけど。。