# Command methods for button, and/or token availability in context

**URL:** <https://community.fibery.io/t/command-methods-for-button-and-or-token-availability-in-context/1035>\
**Category:** Ideas & Features\
**Created:** [October 6, 2020, 10:47am UTC](https://community.fibery.io/t/command-methods-for-button-and-or-token-availability-in-context/1035 "2020-10-06T10:47:34Z")\
**Posts on this page:** 1\
**Showing post:** 3

<div class="post-metadata">

**Author:** ![Haslien](https://sea2.discourse-cdn.com/flex020/user_avatar/community.fibery.io/haslien/32/493_2.png) [@Haslien](https://community.fibery.io/u/Haslien)\
**Post date:** [October 7, 2020, 7:44am UTC](https://community.fibery.io/t/command-methods-for-button-and-or-token-availability-in-context/1035/3 "2020-10-07T07:44:45Z")

</div>

Nice! I can’t find `executeSingleCommand` anywhere in the API docs, ~~but I assume the IntelliSense in the button editor will help and/or that it takes the entire payload that would normally go in to `body`?~~

The other stuff isn’t a huge deal for me, so no worries about that. 🙂

**EDIT:** Indeed it shows up in the IntelliSense, and it takes the `body` payload—except you omit the wrapping array and leave it with 1 command (_as the method name suggests_).

For other people’s reference, here’s an example:

```auto
const fibery = context.getService('fibery');
const e = await fibery.executeSingleCommand({
    "command": "fibery.entity/query",
    "args": {
        "query": {
            "q/from": "Contacts/Customer",
            "q/select": [
                {
                    "user/Orders": {
                        "q/select": [
                            "Customer orders/name",
                            { "workflow/state": ["enum/name"] }
                        ],
                        "q/limit": "q/no-limit"
                    }
                }
            ],
            "q/where": ["=", "fibery/id", "$id"],
            "q/limit": 3
        },
        "params": {
            "$id": "aaaaaa-bbbbb-bbbb-aaaaaaaa"
        }
    }
});

console.log(e);

```

---

_[View the full topic](https://community.fibery.io/t/command-methods-for-button-and-or-token-availability-in-context/1035)._
