HARPA.AI
LIBRARYAPIGUIDESAI COMMANDSBLOG

👤  DABS

Created by Ilya Oyzerskiy
Updated on Aug 12, 18:54
Installed 1 time
SENDS HTTP REQUESTS

How to Use

IMPORT COMMAND

Content

- type: calc
  func: set
  param: skus
  format: json
  value:
    - '443950'
    - '707200'
    - '510482'
    - '626125'
- type: calc
  func: set
  param: results
  format: json
  value: []
- type: loop
  list: skus
  steps:
    - type: navigate
      url: >-
        https://webapps2.abc.utah.gov/ProdApps/ProductLocatorCore?clearFilter=True
      waitForIdle: true
      silent: false
      onFailure: ''
    - type: wait
      for: idle
      timeout: 5000
    - type: paste
      text: '{{item}}'
      mode: null
      selectorType: ai
      lastKey: null
      selector:
        - $matches:
            - $tag: INPUT
            - $role: textbox
            - $id: itemcode
            - $class: form-control
            - $attribute: maxlength=6
            - $attribute: name=Filter.ItemCode
            - $attribute: onkeypress=return ValidNumeric()
            - $attribute: type=text
            - $attribute: value
            - $style: UTIndustry:16px:400:normal
            - $placeholder: Enter 6 digit item code
            - $id: main-content
              traverse: '1:0:0:1'
            - $role: main
              traverse: '1:0:0:1'
            - $class: pb-3
              traverse: '1:0:0:1'
            - $class: navcontainer
              traverse: '0:1:0:0:1'
            - $class: col-sm-10
              traverse: '0:1:0:0:1'
            - $anchor: Item Code (SKU)
              shift: '12:26'
            - $text: Item Code (SKU)
              traverse: '-1:1'
            - $anchor: Show SPA Items Only
              shift: '-14:-37'
            - $text: Show SPA Items Only
              traverse: '-4:1:0:0:1'
            - $anchor: 'OFF'
              shift: 12:-38
            - $text: 'OFF'
              traverse: '-4:1:0:0:1'
          min: 7
        - $size: 1
      item:
        type: element
        container:
          __$ht: element
          id: 0
        value: Enter 6 digit item code
    - type: wait
      for: 1s
    - type: click
      selectorType: ai
      selector:
        - $matches:
            - $tag: BUTTON
            - $role: button
            - $class: btn
            - $class: btn-primary
            - $attribute: type=button
            - $attribute: 'style=width: 50%;'
            - $attribute: onclick=reloadtable();
            - $style: UTIndustry:14.6667px:400:normal
            - $content: Search
            - $id: main-content
              traverse: '3:0:0'
            - $role: main
              traverse: '3:0:0'
            - $class: pb-3
              traverse: '3:0:0'
            - $class: navcontainer
              traverse: '0:3:0:0'
            - $class: col-sm-10
              traverse: '0:3:0:0'
            - $anchor: Show SPA Items Only
              shift: '66:70'
            - $text: Show SPA Items Only
              traverse: '-4:3:0:0'
            - $anchor: Show
              shift: 92:-55
            - $text: Show
              traverse: '-6:3:0:0'
            - $anchor: 'OFF'
              shift: '92:69'
            - $text: 'OFF'
              traverse: '-4:3:0:0'
          min: 5
        - $size: 1
      item:
        type: element
        container:
          __$ht: element
          id: 1
        value: Search
    - type: wait
      for: idle
      timeout: 5000
    - type: gpt
      prompt: >
        Look at the DABS search results currently displayed on the page.


        There should be exactly one result because the search was performed
        using a unique SKU.


        Extract the values from that single result row.


        Return ONLY this JSON:


        {
          "product_name": "",
          "sku": "",
          "subcategory": "",
          "status": "",
          "warehouse_qty": "",
          "store_qty": "",
          "on_order_qty": "",
          "current_price": ""
        }


        Do not guess or calculate any values. Use only information actually
        displayed in the result row.


        If there is no result, return:


        {
          "product_name": null,
          "sku": "{{sku}}",
          "error": "Product not found"
        }


        SKU searched: {{item}}


        Page content:

        {{page}}
      param: result
    - type: calc
      func: list-add
      index: last
      list: results
      item: result
- type: gpt
  prompt: >-
    Create a report from all DABS product results in {{results}}.


    Create a table with:


    Product Name | SKU | Subcategory | Status | Warehouse Qty | Store Qty | On
    Order Qty | Current Price


    Include every result.


    Do not change, calculate, or infer any values.

    Use exactly the values returned by the searches.


    Return ONLY a JSON array of objects.


    [
      {
        "product_name": "",
        "sku": "",
        "subcategory": "",
        "status": "",
        "warehouse_qty": "",
        "store_qty": "",
        "on_order_qty": "",
        "current_price": ""
      }
    ]


    Include one object for every product result.


    Each result must be a JSON object, NOT a quoted string.


    Do not escape the JSON.

    Do not wrap the objects in quotes.

    Do not wrap the array inside another "result" property.

    Do not use markdown.

    Do not return any other text.
  param: email_body
- type: request
  url: https://hook.us2.make.com/3xmt4unaqd72eetafm66s692aluh1c7k
  method: post
  headers:
    Content-Type: application/json
  body: |-
    {
      "result": {{results}}
    }
  auth:
    enabled: false
    username: ''
    password: ''
  param: ''
  bodyInvalid: true
  headersInvalid: false
Notice: Please read before using

This automation command is created by a community member. HARPA AI team does not audit community commands.

Please review the command carefully and only install if you trust the creator.

Contact us
HomeUse CasesGuidesPrivacy PolicyTerms of Service
CAN WE STORE COOKIES?
Our website uses cookies for the purposes of accessibility and security. They also allow us to gather statistics in order to improve the website for you. More info: Privacy Policy