# \[Bug report\] Interactions return nothing

**URL:** https://forums.creativeclouddeveloper.com/t/bug-report-interactions-return-nothing/2214
**Category:** Adobe XD
**Tags:** interactions
**Created:** [November 12, 2020, 7:53pm UTC](https://forums.creativeclouddeveloper.com/t/bug-report-interactions-return-nothing/2214 "2020-11-12T19:53:30Z")
**Posts on this page:** 7
**Page:** 1

<div class="post-metadata">

### Author: ![imougy](https://sea1.discourse-cdn.com/flex015/user_avatar/forums.creativeclouddeveloper.com/imougy/32/1019_2.png) [@imougy](https://forums.creativeclouddeveloper.com/u/imougy)
#### Post date: [November 12, 2020, 7:53pm UTC](https://forums.creativeclouddeveloper.com/t/bug-report-interactions-return-nothing/2214/1 "2020-11-12T19:53:30Z")

</div>

Hi all,  
In my plugin, I am trying to fetch all the interactions but it seems the API is always returning null.  
Here is the code and I am 100% sure there is at least one interaction in the document:-

const interactions = require(‘interactions’);  
async function myEntryPluginEntryPoint(selection, root) {  
var allInteractions = interactions.allInteractions;  
console.log(`Interactions: ${allInteractions.length}`);  
allInteractions.forEach(interaction =\>{  
console.log("Trigger: " + interaction.trigger.type + " -\> Action: " + interaction.action.type);  
})  
}

Thanks,

---

<div class="post-metadata">

### Author: ![kerrishotts](https://sea1.discourse-cdn.com/flex015/user_avatar/forums.creativeclouddeveloper.com/kerrishotts/32/8_2.png) [@kerrishotts](https://forums.creativeclouddeveloper.com/u/kerrishotts)
#### Post date: [November 12, 2020, 9:06pm UTC](https://forums.creativeclouddeveloper.com/t/bug-report-interactions-return-nothing/2214/2 "2020-11-12T21:06:04Z")

</div>

@DavidXD - See above ^^^^

---

<div class="post-metadata">

### Author: ![imougy](https://sea1.discourse-cdn.com/flex015/user_avatar/forums.creativeclouddeveloper.com/imougy/32/1019_2.png) [@imougy](https://forums.creativeclouddeveloper.com/u/imougy)
#### Post date: [November 13, 2020, 8:07pm UTC](https://forums.creativeclouddeveloper.com/t/bug-report-interactions-return-nothing/2214/3 "2020-11-13T20:07:09Z")

</div>

Thank you @kerrishotts @DavidXD. Here is another exact issue reported in the comments section Aug 4th 2020, so you can close both (and to be frank, it is disappointing that it was reported for that long without a fix)([How to get the type of object that has an interaction?](http://forums.creativeclouddeveloper.com/t/how-to-get-the-type-of-object-that-has-an-interaction/1820/3)).

---

<div class="post-metadata">

### Author: ![DavidXD](https://sea1.discourse-cdn.com/flex015/user_avatar/forums.creativeclouddeveloper.com/davidxd/32/909_2.png) [@DavidXD](https://forums.creativeclouddeveloper.com/u/DavidXD)
#### Post date: [November 16, 2020, 8:55pm UTC](https://forums.creativeclouddeveloper.com/t/bug-report-interactions-return-nothing/2214/4 "2020-11-16T20:55:36Z")

</div>

_interactions.allInteractions_ returns an array of interactions. And each of those interactions contains a “_triggerNode_” and a nested “_interactions_” array, which is a little confusing:

`{triggerNode: Ellipse ('Ellipse 1') {...}, interactions: [{trigger: [Object], action: [Object]}]}`

The elements in the nested “_interactions_” array contain “_trigger.type_” and “_action.type_”. This code works for me in XD 34:

```
const interactions = require("interactions");

let allInteractions = interactions.allInteractions;
    console.log("All interactions length: " + allInteractions.length);
    allInteractions.forEach(myInt => {
        console.log("myInt: ", myInt);
        if (myInt.triggerNode) {
            console.log("myInt.triggerNode: ", myInt.triggerNode);
        }
        if (myInt.interactions) {
            console.log(" myInt.interactions.length: " + myInt.interactions.length);
            myInt.interactions.forEach(myDetailedInt => {
                console.log(" myDetailedInt: ", myDetailedInt);
                if (myDetailedInt.trigger) {
                    console.log(" myDetailedInt.trigger.type: ", myDetailedInt.trigger.type);
                }
                if (myDetailedInt.action) {
                    console.log(" myDetailedInt.action.type: ", myDetailedInt.action.type);
                }
            });
        }
    });
```

---

<div class="post-metadata">

### Author: ![imougy](https://sea1.discourse-cdn.com/flex015/user_avatar/forums.creativeclouddeveloper.com/imougy/32/1019_2.png) [@imougy](https://forums.creativeclouddeveloper.com/u/imougy)
#### Post date: [November 16, 2020, 11:39pm UTC](https://forums.creativeclouddeveloper.com/t/bug-report-interactions-return-nothing/2214/5 "2020-11-16T23:39:37Z")

</div>

@DavidXD, thank you so much for your time, I really appreciate that. I made a simple xd file, a rectangle and a circle, I have one interaction between the rectangle and the circle. I executed your code as is and I get zero length interactions.  
I have xd 34.1.12.9 running on Mac.  
Here is a [link](https://www.dropbox.com/s/ayics59z79bxzsj/one%20interaction.xd?dl=0) to the xd file that I pointed above.  
As in my previous comment, there is another developer mentioning the same issue.  
Any idea what to do, I am running out of options.  
Thanks,  
Ilam

---

<div class="post-metadata">

### Author: ![DavidXD](https://sea1.discourse-cdn.com/flex015/user_avatar/forums.creativeclouddeveloper.com/davidxd/32/909_2.png) [@DavidXD](https://forums.creativeclouddeveloper.com/u/DavidXD)
#### Post date: [November 17, 2020, 3:00am UTC](https://forums.creativeclouddeveloper.com/t/bug-report-interactions-return-nothing/2214/6 "2020-11-17T03:00:12Z")

</div>

Thank you for the XD document. That helps me better understand that your document has Scroll-To interactions, and that is the type of interaction that is missing from what is returned by the “_interactions.allInteractions_” API. Unfortunately that is a limitation of this API at this time as stated in the [documentation](https://adobexdplatform.com/plugin-docs/reference/interactions.html#interactionsallinteractions--arraytriggernode-scenenode-interactions-arrayinteraction):

> [@](#):
>
> Currently, this API excludes some types of interactions: keypress/gamepad, scrolling, hover, component state transitions, or non-speech audio playback.

I wrote a feature request on our internal system to make sure this issue is being tracked. And I’m sorry to say that I do not think there is any workaround.

---

<div class="post-metadata">

### Author: ![imougy](https://sea1.discourse-cdn.com/flex015/user_avatar/forums.creativeclouddeveloper.com/imougy/32/1019_2.png) [@imougy](https://forums.creativeclouddeveloper.com/u/imougy)
#### Post date: [November 17, 2020, 5:38pm UTC](https://forums.creativeclouddeveloper.com/t/bug-report-interactions-return-nothing/2214/7 "2020-11-17T17:38:02Z")

</div>

Makes perfect sense @DavidXD. Sorry I didn’t pay attention it is a scroll type, I was thinking tap is not excluded and that is it.  
Thanks for your time and excellent product.
