Author Topic: Help with Multiple Columns in Payload?  (Read 1142 times)

0 Members and 1 Guest are viewing this topic.

DHHJ

  • $upporter
  • Contributor
  • *****
  • Posts: 62
  • Karma: 1
    • View Profile
Help with Multiple Columns in Payload?
« on: July 30, 2014, 05:09:23 PM »
I'm trying to figure out if/how I can access a "database" of items using the payload and xml features of VC.

As a hypothetical (and strange!) example, if I had a list of 50 peoples names, and for each name I wanted to track their phone extension, their PC name, their favourite sports team and their age, how could I store this in a xml file that could be used with VC?

I am thinking of asking "What is John's age?" or "What is the name of Jane's PC" and getting an appropriate response?


Haddood

  • $upporter
  • Hero Member
  • *****
  • Posts: 688
  • Karma: 22
    • View Profile
Re: Help with Multiple Columns in Payload?
« Reply #1 on: July 30, 2014, 05:39:52 PM »
as far as I know you will have to convert your DB into XML files ... the scrape the info you need ... I think payloads support only 2 columns for the moment

I added a feature request to increase that a while ago. see http://voxcommando.com/forum/index.php?topic=1562.0). maybe if enough users need it, and it is within VC scope, James might consider adding it :)
When Voice command gets tough, use hand gestures

nime5ter

  • Administrator
  • Hero Member
  • *****
  • Posts: 2009
  • Karma: 61
    • View Profile
    • Getting Started with VoxCommando
Re: Help with Multiple Columns in Payload?
« Reply #2 on: July 30, 2014, 07:15:38 PM »
There may be different solutions, depending on what kind of database you're talking about. As Haddood says, currently there's no such thing as a multi-column payload.

But let's imagine you have a group of 3 different commands:
What is name's phone number?
What is name's favourite sport?
What is name's birthday?

Each command has its own payload xml (phone.xml ; sport.xml ; birthday.xml), associating your list of contact names (as the phrase) with the relevant info (as the value).

So, let's say you already have a spreadsheet with all the above info, you can copy and paste the two relevant columns directly into a blank payload xml file.

Create your command.
Create a new value>phrase payload.
When you open the new, empty payload xml table, you can right-click on the top, leftmost cell and you will have the option to "paste rows from clipboard". So select the 2 columns you need from your spreadsheet, and paste them into your payload xml file. Save.

Do the same for your other commands.

It's not ideal for data that is changing regularly, but for more static information it is probably the easiest non-programmatic option.
« Last Edit: July 30, 2014, 07:22:36 PM by nime5ter »
TIPS: POST VC VERSION #. Explain what you want VC to do. Say what you've tried & what happened, or post a video demo. Attach VC log. Link to instructions followed.  Post your command (xml)

nime5ter

  • Administrator
  • Hero Member
  • *****
  • Posts: 2009
  • Karma: 61
    • View Profile
    • Getting Started with VoxCommando
Re: Help with Multiple Columns in Payload?
« Reply #3 on: July 31, 2014, 04:33:34 PM »
Another option might be to create a payload xml file where the phrase is your contact name and the value is all of the other profile info, with that info formatted in a standardized way in your value field. (e.g. {cell:"514-333-3333"}{hobby:"sky diving"}{computer:"xenon"}{dob:"01-Jan-1942"})

The only thing is, I'm not sure if there's a character limit to value fields ... (James?)

Anyhow, if that's not a problem:

Then with some fairly simple RegEx you could use one payload xml file but retrieve different sub-values for any given contact name.

You'd probably still want to have multiple commands, but you can generate one payload xml file.

And if your database can output clean xml or even a tab delimited format, it's probably feasible to automate that payload xml generation.

Then again, if it already uses or generates xml, you might also be able to scrape the info of interest directly from the source. Maybe you'd want to create a payload xml with just contact names, so that you can pass that data in order to scrape a particular entry.

... This is why I say that it depends on the database.
« Last Edit: July 31, 2014, 05:02:37 PM by nime5ter »
TIPS: POST VC VERSION #. Explain what you want VC to do. Say what you've tried & what happened, or post a video demo. Attach VC log. Link to instructions followed.  Post your command (xml)