AssetExplorer

    Custom Schedules

    Custom schedules enable you to access any data from AssetExplorer and schedule periodic customized actions such as sending notifications or updating asset details. You can also synchronize AssetExplorer data with other third-party applications to perform various actions, such as send mailer campaigns to technicians at regular intervals.

    Role Required: SDAdmin


    How are customized actions scheduled in AssetExplorer? 

    1. Access the required data as queries through a query report.
    2. Create a script using any scripting language and save it on your device. Alternatively, you can create scripts in scheduled function using DELUGE.
    3. Pass the data in the query report as arguments to customized script files.
    4. Schedule the time to execute the customized action.
    5. The specified actions in the script file are executed automatically at regular intervals.


    Configure Custom Schedules 

    Go to Admin > Automation > Custom Schedules and click New.

    The New Custom Schedule form will be displayed. Use the following pointers to configure a custom schedule:

    Step 1: Fill out Custom Schedule Details

     

    • Enter the schedule name. This is a mandatory field.
    • Add a description for the custom schedule.

     

    Step 2: Configure Action

    • In the Executordrop-down, you can configure the action to be performed in two ways:
      • Execute Script - Create a script using any scripting language. Save the script file under [SDP_Home]/integration/custom_scripts/ folder. In the text field, specify the script file name using the command py filename.py to fetch the script.
      • Execute Function - Create and save your own scripts using Deluge in scheduled function. Choose the relevant function or create a new function from the drop-down. Click here to learn more.
    • Choose the query report to be passed as the argument. You can pass up to 3 query reports as arguments.

    The query report visibility must be set as Public. Private reports cannot be fetched into custom schedules. 

    Step 3: Configure Schedule Info

     

    • Specify how frequently you want to run the custom schedule. Custom schedules will be executed irrespective of operational hours.
    • Select a date range and time.
    • In the Repeats drop-down, choose the frequency for the custom schedule: once, hourly, daily, weekly, monthly, or yearly.
    • Enable Advanced Optionsto set the frequency dynamically as follows:
      • Daily - Runs according to the specified number of days.
      • Weekly - Specify the number of weeks and days to run the schedule.
      • Monthly - Specify the days of the month to run the schedule.
      • Yearly - Specify the months and days in a year dynamically to run the schedule.
    • Configure the end time for the schedule.
      • Never - Set the schedule to run always.
      • After - Specify the number of occurrences after which the repeat ends.
      • On - Specify the date to end the repeat frequency.
    • Click Save.

     

    How are query reports converted as arguments?

    Let's assume the query report Loan Expired assets by Asset Type gives the following result:

    Loan ID

    Asset Expired

    Technician

    47

    Dell Workstation 12

    Heather Graham

    48

    Network Server B

    Shawn Adams


    While executing scripts

    When the schedule starts, the query report results are saved as an individual JSON file under [SDP_Home]/integration/custom_schedule_reports/ directory. The result JSON is an array of JSON objects, one JSON object for each row. Each JSON object has column names as the keys and corresponding data as the values as shown below:

    [
        {
            "Loan ID":"47",
            "Asset Expired":"Dell Workstation 12",
            "Technician":"Heather Graham"
        },
        {
            "Loan ID":"48",
            "Asset Expired":"Network Server B",
            "Technician":"Shawn Adams"
        }
    ]

    The JSON file paths of the reports are passed to the as arguments to custom schedule executor. After the action is executed, the JSON file will be deleted.

    While executing scheduled functions

    When the schedule starts, the associated query reports are generated.

    The report can be fetched into a scheduled function using reportObj.get("Report_Name"); command. To fetch the report data, use the following command: dataObj = reportObj.get("Report_name");

    If the report contains multiple columns, the report columns can be fetched as using a loop:

    for each data in dataObj{
    column_name = data.get("column_name");
    }

    You can then specify the API call to perform an action, such as updating an asset state. When a custom schedule is executed, the scheduled function fetches the report and executes the API function on the report data in the data object.

    View Custom Schedule Results 

    The Result column in the custom schedules list view has the latest output of the corresponding action.

    Detailed results of the executed action can be viewed in the System Log Viewer under Quick Actions or from the Community tab.

    Use cases for Custom Schedules

    You can use custom schedules to periodically:

    1. Reopen purchase orders in bulk after a specific time interval or when a specific criterion is met.
    2. Send custom email or SMS notifications for software that match specific criteria.
    3. Schedule mailer campaigns with technicians list as input arguments.
    4. Check and update asset data from other asset management tools.
    5. Send notifications in certain scenarios.
    6. Send slack notifications for tasks.
    7. Integrate with external knowledge base tools.  

    Support 

    If you have any questions about custom schedules, please post it in our community forum.

    Did you create something amazing with custom schedules? Post your success story on our resources forum.

     

    Zoho Corp. All rights reserved.