StackStorm-Exchange / stackstorm-excel

excel actions to read and write variables to an excel file
https://exchange.stackstorm.org/
Apache License 2.0
9 stars 8 forks source link

Add support for integer and float keys & values for set and get variables #10

Closed humblearner closed 6 years ago

humblearner commented 6 years ago

Get variable based on the int key:

$ st2 run excel.get_variables key=23 excel_file='/home/vagrant/testme.xlsx'
.
id: 5a1e19746d90e814960b4630
status: succeeded
parameters:
  excel_file: /home/vagrant/testme.xlsx
  key: '23'
result:
  exit_code: 0
  result:
    this works: 'no'
    title: 99.99
  stderr: ''
  stdout: ''

Set int variable based on the int key:

$ st2 run excel.set_variables key=23 sheet=Sheet1 excel_file='/home/vagrant/testme.xlsx' variables={'"title":1200'}
.
id: 5a1e199d6d90e814960b4633
status: succeeded
parameters:
  excel_file: /home/vagrant/testme.xlsx
  key: '23'
  sheet: Sheet1
  variables: '{"title":1200}'
result:
  exit_code: 0
  result: Success
  stderr: ''
  stdout: ''

Get updated variable title in this case based on the int key:

$ st2 run excel.get_variables key=23 excel_file='/home/vagrant/testme.xlsx'
.
id: 5a1e19a36d90e814960b4636
status: succeeded
parameters:
  excel_file: /home/vagrant/testme.xlsx
  key: '23'
result:
  exit_code: 0
  result:
    this works: 'no'
    title: 1200
  stderr: ''
  stdout: ''
vagrant@u14:~$