IBM QRadar SOAR

IBM QRadar SOAR

Join this online user group to communicate across Security product users and IBM experts by sharing advice and best practices with peers and staying up to date regarding product enhancements.

 View Only
  • 1.  Date Picker (Default Value)

    Posted 06/26/21 01:49 PM
    Hi All,

    I have a date picker field as a column in a table.  Is there a way to have this field default to "today's" date?  Would like to have it preset for users whenever they add a row.

    Thanks

    ------------------------------
    Paul Formosa
    ------------------------------


  • 2.  RE: Date Picker (Default Value)

    Posted 07/01/21 04:08 PM

    Paul,

    Not that I'm aware of.

    You could create a rule that triggers whenever a row is added to the data table and calls a script that populates the row column with the current time. 

    Some examples of how to populate date picker / datetime picker fields can be found here, although they're using the python2 packages.




    ------------------------------
    Liam Mahoney
    ------------------------------



  • 3.  RE: Date Picker (Default Value)

    Posted 07/05/21 01:43 PM
    Thanks Liam.

    ------------------------------
    PAUL FORMOSA
    ------------------------------



  • 4.  RE: Date Picker (Default Value)

    Posted 07/06/21 10:45 AM
    Hi Paul,

    Just to follow up on Liams good suggestion, here is the rule and Python 3 script that could set the date picker or date time picker AFTER a user has left it blank. Unfortunately there is not a way to auto populate the row in the UI, but there should be an easy option to click 'now' when selecting the value. I've included date picker and date time picker in the script just in case you need both.

    from datetime import datetime
    today = datetime.today()
    
    # If user left date time picker blank
    if row['date_time_picker'] is None:
      row['date_time_picker'] = today
    
    # if user left date picker blank
    if row['date_picker'] is None:
      row['date_picker'] = today.strftime('%Y-%m-%d')​


    ------------------------------
    Sean Mc Cann
    ------------------------------