How can Flow Designer email the schedule for the day?

Sato3
Tera Contributor

Hi, All.

I would like to use Flow Designer to fulfill the following requirements. Do you have any advice?

Requirements : 

Every day, once a day, if the Last_login field in the User [sys_user] table contains today's date, I would like to email the user who is the instance administrator with the login record information for the day.

 

This requirement seems feasible, but is there any good idea?

Thank you

1 ACCEPTED SOLUTION

Example below:

find_real_file.png

 

find_real_file.png

 

find_real_file.png

View solution in original post

27 REPLIES 27

一般的に他社で行われている方法を説明します。

ログイン情報はsyseventテーブルにあります。フィルタ条件はName=Loginです。Parm1にログインユーザIDが記載されます。syseventテーブルにはログイン失敗の情報はlogin.failedとして記述されます。他社ではログインした時刻と失敗した時刻のレポートを作成されています。

nameSTARTSWITHlogin^processedONToday@javascript:gs.beginningOfToday()@javascript:gs.endOfToday()

データベースビューを作成してadminロール(テーブル:sys_user_has_role)のユーザを抽出することができます。

他社ではこのビューをスケジュールレポートでメールされています。

フローデザイナを利用する場合はこのビューのレコードからメールを作成するnotificationを作成するか、notificationのスクリプトでsysenventテーブルとsys_user_has_roleを検出することができます。それで作成したnotificationをフローデザイナーのsend notificationステップからそのnotificationを起動することができます。

Notificationを利用しない場合は上に回答したようにフローデザイナーでアクションを作成して、そのアクションでLook up Recordsステップを作成して、その後にスクリプトステップで抽出したレコードを文字列に変換します。Send Emailステップでその文字列を本文に配置します。Send Emailステップにはスクリプトを記述できません。本文にスクリプトを記述する場合はnotificationを利用します。

Notificationにスクリプトの記述例

https://docs.servicenow.com/bundle/paris-servicenow-platform/page/script/server-scripting/reference/...

send notificationステップの説明

https://docs.servicenow.com/bundle/rome-servicenow-platform/page/administer/flow-designer/reference/...

 

>>>ログイン情報はsyseventテーブルにあります。フィルタ条件はName=Loginです。Parm1にログインユーザIDが記載されます。syseventテーブルにはログイン失敗の情報はlogin.failedとして記述されます。他社ではログインした時刻と失敗した時刻のレポートを作成されています。


レポートを作成する際に Event[sysevent] テーブルは参照できませんでしたが、このレポートは最新のバージョンによって、もしくは複数のバージョンでの利用は不可能なのでしょうか?

 

>>>その後にスクリプトステップで抽出したレコードを文字列に変換します。

 

また、Flow Designerの配列の仕組みがよく理解できておりませんが、レコードを文字列に変換する、というのは設定している変数を文字列に設定していれば変換されるものでしょうか?

直接システムテーブルからレポートを作成する場合は次のページを参照。

https://docs.servicenow.com/bundle/sandiego-now-intelligence/page/use/reporting/concept/c_ReportOnSy...