Excelをインポートセットした際、Excelデータの末尾スペースが自動削除されてしまう
- 新着としてマーク
- ブックマーク
- 購読
- ミュート
- RSS フィードを購読する
- ハイライト
- 印刷
- 不適切なコンテンツを報告
07-07-2024 10:09 PM
Excelのインポートセットについて質問です。
Excelデータのうち、末尾に半角スペースがある場合、SNowにインポートセットしたら自動で末尾の半角スペースが削除されてしまいます。
(全角は削除されません。半角のみ削除されます)
データの先頭に半角スペースがある場合は、設定により自動削除されないようにできるのですが、、
(以下の、「glide.import set.preserve.leading.spaces」をtrueにしました)
赤枠部分の通り、インポートセット時、末尾のスペースは削除されてしまいます。
しかし、エクセル中の末尾半角スペースを保持したまま、SNowにインポートセットしたいです。
オープンソース使用する以外で、何か方法はありますでしょうか?
ヒントを頂ければ幸いです!
- 新着としてマーク
- ブックマーク
- 購読
- ミュート
- RSS フィードを購読する
- ハイライト
- 印刷
- 不適切なコンテンツを報告
07-08-2024 08:04 AM
Hi @MarikoI
If you want to retain trailing half-width spaces from Excel data when importing and you're already aware that ServiceNow automatically removes these trailing spaces except when configured otherwise (`glide.import.set.preserve.leading.spaces`), here are a few suggestions and considerations:
1. Text Qualifiers in Excel: One approach is to enclose your data in Excel cells with double quotes (`"`). This practice tells Excel to treat the enclosed text as a single unit, including any leading or trailing spaces. When importing into ServiceNow, these quotes are typically removed, but the spaces within them are preserved.
2. CSV Format: Instead of directly importing from Excel, save your Excel file as a CSV (Comma-Separated Values) file. CSV files handle text differently, and trailing spaces are often preserved as they are part of the cell's content. ServiceNow imports CSV files similarly to Excel files but may treat trailing spaces differently depending on the import settings.
3. ServiceNow Transform Maps: When setting up your Import Sets in ServiceNow, you can use Transform Maps to define how data from your import set should be mapped to ServiceNow tables. Within Transform Maps, you have control over field mappings, data transformations, and can potentially manipulate data to retain trailing spaces through scripting or mappings.
4. Post-Import Scripts: After importing data into ServiceNow, you can run scripts (Business Rules, Script Includes, etc.) to manipulate imported data further. This approach allows you to handle data formatting issues, such as ensuring trailing spaces are preserved in specific fields.
5. Custom Import Logic: Depending on your ServiceNow instance's customization capabilities, you may develop custom import logic or utilize Integration Hub to preprocess data before importing it into ServiceNow. This approach gives you more control over how data is handled during the import process.
In summary, while ServiceNow does have default behavior to remove trailing half-width spaces during imports, you can leverage Excel formatting, CSV file handling, Transform Maps, post-import scripts, or custom import logic to retain or manipulate trailing spaces as needed for your specific requirements. Each approach has its considerations based on your data volume, frequency of imports, and overall system architecture.
———————————————-
Please consider marking my reply as Helpful👍 and/or Accept Solution☑️, if applicable. Thanks!
- 新着としてマーク
- ブックマーク
- 購読
- ミュート
- RSS フィードを購読する
- ハイライト
- 印刷
- 不適切なコンテンツを報告
07-08-2024 08:59 PM
解答頂きありがとうございました!助かります!
1の方法を試して、Excelデータをダブルクォーテーション(”)で囲いました。
しかしインポートセット後、SNowには「”」も表示されてしまいます。
「”」は自動で削除されたら良いのですが、、
こちらも併せてヒントあれば教えて頂けると幸いです。