kind: AdaptiveDialog
beginDialog:
  kind: OnConversationStart
  id: main
  actions:
    - kind: SendActivity
      id: sendMessage_M0LuhV
      activity:
        text:
          - Hello, I'm {System.Bot.Name}, a virtual assistant. Just so you are aware, I sometimes use AI to answer your questions. If you provided a website during creation, try asking me about it! Next try giving me some more knowledge by setting up generative AI.
        speak:
          - Thanks for calling, how can I help?

    - kind: Question
      id: pdQTWP
      interruptionPolicy:
        allowInterruption: true

      alwaysPrompt: true
      variable: init:Global.SNEmailAddress
      prompt: What is your email address that you have registered in ServiceNow?
      entity: EmailPrebuiltEntity

    - kind: InvokeConnectorAction
      id: invokeConnectorAction_DaXEzi
      input:
        binding:
          sysparm_display_value: true
          sysparm_exclude_reference_link: true
          sysparm_limit: 1
          sysparm_query: =Concatenate("email=",Global.SNEmailAddress)
          tableType: sys_user

      output:
        binding:
          result: Topic.SNUserResult

      connectionReference: cr5e0_itHelpdeskTicketAssistant.cr.gMQxUFXM
      connectionProperties:
        mode: Maker

      operationId: GetRecords
      dynamicOutputSchema:
        kind: Record
        properties:
          result:
            order: 0
            type:
              kind: Table
              properties:
                active:
                  displayName: Active
                  description: Inactive users do not show in user choice lists
                  order: 21
                  type: String

                avatar:
                  displayName: Avatar
                  order: 52
                  type: String

                building:
                  displayName: Building
                  order: 6
                  type: String

                calendar_integration:
                  displayName: Calendar integration
                  order: 0
                  type: String

                city:
                  displayName: City
                  order: 29
                  type: String

                company:
                  displayName: Company
                  order: 41
                  type: String

                cost_center:
                  displayName: Cost center
                  order: 23
                  type: String

                country:
                  displayName: Country code
                  order: 1
                  type: String

                date_format:
                  displayName: Date format
                  description: Display dates with this format (blank means system default)
                  order: 57
                  type: String

                default_perspective:
                  displayName: Default perspective
                  order: 20
                  type: String

                department:
                  displayName: Department
                  order: 42
                  type: String

                email:
                  displayName: Email
                  order: 44
                  type: String

                employee_number:
                  displayName: Employee number
                  order: 26
                  type: String

                enable_multifactor_authn:
                  displayName: Enable Multifactor Authentication
                  order: 9
                  type: String

                failed_attempts:
                  displayName: Failed login attempts
                  order: 30
                  type: String

                federated_id:
                  displayName: Federated ID
                  order: 36
                  type: String

                first_name:
                  displayName: First name
                  order: 43
                  type: String

                gender:
                  displayName: Gender
                  order: 28
                  type: String

                home_phone:
                  displayName: Home phone
                  order: 17
                  type: String

                internal_integration_user:
                  displayName: Internal Integration User
                  order: 37
                  type: String

                introduction:
                  displayName: Prefix
                  order: 45
                  type: String

                last_login:
                  displayName: Last login
                  order: 19
                  type: String

                last_login_time:
                  displayName: Last login time
                  order: 3
                  type: String

                last_name:
                  displayName: Last name
                  order: 50
                  type: String

                ldap_server:
                  displayName: LDAP server
                  order: 38
                  type: String

                location:
                  displayName: Location
                  order: 58
                  type: String

                locked_out:
                  displayName: Locked out
                  description: When checked, user cannot login
                  order: 48
                  type: String

                manager:
                  displayName: Manager
                  order: 47
                  type: String

                middle_name:
                  displayName: Middle name
                  order: 53
                  type: String

                mobile_phone:
                  displayName: Mobile phone
                  order: 39
                  type: String

                name:
                  displayName: Name
                  order: 25
                  type: String

                notification:
                  displayName: Notification
                  description: Enable or disable notifications for this user ie. email, SMS etc
                  order: 8
                  type: String

                password_needs_reset:
                  displayName: Password needs reset
                  description: User will be prompted to change password at next login
                  order: 27
                  type: String

                phone:
                  displayName: Business phone
                  order: 24
                  type: String

                photo:
                  displayName: Photo
                  order: 51
                  type: String

                preferred_language:
                  displayName: Language
                  order: 46
                  type: String

                roles:
                  displayName: Roles
                  order: 32
                  type: String

                schedule:
                  displayName: Schedule
                  order: 56
                  type: String

                source:
                  displayName: Source
                  order: 4
                  type: String

                state:
                  displayName: State / Province
                  order: 13
                  type: String

                street:
                  displayName: Street
                  order: 40
                  type: String

                sys_class_name:
                  displayName: Class
                  order: 34
                  type: String

                sys_created_by:
                  displayName: Created by
                  order: 15
                  type: String

                sys_created_on:
                  displayName: Created
                  order: 11
                  type: String

                sys_domain:
                  displayName: Domain
                  description: Domain to which the user belongs
                  order: 12
                  type: String

                sys_domain_path:
                  displayName: Domain Path
                  order: 22
                  type: String

                sys_id:
                  displayName: Sys ID
                  order: 35
                  type: String

                sys_mod_count:
                  displayName: Updates
                  order: 49
                  type: String

                sys_tags:
                  displayName: Tags
                  order: 54
                  type: String

                sys_updated_by:
                  displayName: Updated by
                  order: 10
                  type: String

                sys_updated_on:
                  displayName: Updated
                  order: 5
                  type: String

                time_format:
                  displayName: Time format
                  description: Display times with this format (blank means system default)
                  order: 18
                  type: String

                time_zone:
                  displayName: Time zone
                  order: 55
                  type: String

                title:
                  displayName: Title
                  order: 33
                  type: String

                user_name:
                  displayName: User ID
                  order: 31
                  type: String

                user_password:
                  displayName: Password
                  order: 2
                  type: String

                vip:
                  displayName: VIP
                  order: 14
                  type: String

                web_service_access_only:
                  displayName: Web service access only
                  description: Prevent user from accessing UI, and require a SOAP role to make API protocol calls (such as SOAP and WSDL requests)
                  order: 7
                  type: String

                zip:
                  displayName: Zip / Postal code
                  order: 16
                  type: String

    - kind: SetVariable
      id: setVariable_1Lnxc1
      variable: Global.SNUserSysID
      value: =First(Topic.SNUserResult).sys_id

    - kind: SetVariable
      id: setVariable_NTANpV
      variable: Global.UserName
      value: =First(Topic.SNUserResult).name

    - kind: SendActivity
      id: sendActivity_2U8biF
      activity:
        text:
          - Thanks for that {Global.UserName}.  How can I help you today?
        quickReplies:
          - kind: MessageBack
            title: Ticket Status
            text: What is the status of my ticket?

          - kind: MessageBack
            title: User Profile Info
            text: What is the information in my user profile?

          - kind: MessageBack
            title: Local Weather
            text: =Concatenate("What is the weather in ",First(Topic.SNUserResult).city)