# How to evaluate trigger (when) cards with arguments

**URL:** <https://community.homey.app/t/how-to-evaluate-trigger-when-cards-with-arguments/77965>\
**Category:** Developers\
**Created:** [March 18, 2023, 11:10am UTC](https://community.homey.app/t/how-to-evaluate-trigger-when-cards-with-arguments/77965 "2023-03-18T11:10:13Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![OH2TH](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/oh2th/32/111414_2.png) [@OH2TH](https://community.homey.app/u/OH2TH)\
**Post date:** [March 18, 2023, 11:10am UTC](https://community.homey.app/t/how-to-evaluate-trigger-when-cards-with-arguments/77965/1 "2023-03-18T11:10:14Z")

</div>

I’m trying to do the code for trigger cards with arguments but can’t figure out how it is evaluated which flow cards are actually triggered.

For example two trigger flow cards where there is argument for “minutes”.

 ![Screenshot 2023-03-18 at 12.59.56](https://us1.discourse-cdn.com/flex025/uploads/athom/original/3X/5/0/50659963f8f338b8e1748bedf36be13f3272fe9a.png)

How can I trigger now the one with 6 minutes, so that 4 minutes doesn’t trigger.

```auto
        // Get the "trigger_in" card for the scheduler device.
        const device_schedule_trigger_in = schedulerDevice.homey.flow.getDeviceTriggerCard('device_schedule_trigger_in');
        device_schedule_trigger_in.getArgumentValues(schedulerDevice)
          .then((device_schedule_trigger_in_args) => {
            this.log(`${this.myAppIdVersion} - device_schedule_trigger_in_args: ${JSON.stringify(device_schedule_trigger_in_args, null, 2)}`);
          });

```

I can find both cards’ arguments, however there is no reference id to the flow card itself just the key - value pairs for the args:

```auto
[log] 2023-03-18 11:05:00 [AlarmUtils] fi.oh2th.alarmutils/1.8.0 - device_schedule_trigger_in_args: [
  {
    "minutes": 4
  },
  {
    "minutes": 6
  }
]

```

But the question is, how to trigger the right cards based in its argument?

---

<div class="post-metadata">

**Author:** ![Jero](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/jero/32/17556_2.png) [@Jero](https://community.homey.app/u/Jero)\
**Post date:** [March 18, 2023, 11:31am UTC](https://community.homey.app/t/how-to-evaluate-trigger-when-cards-with-arguments/77965/2 "2023-03-18T11:31:42Z")

</div>

Compare the minutes in the run listener?

---

<div class="post-metadata">

**Author:** ![Arie\_J\_Godschalk](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/arie_j_godschalk/32/63027_2.png) [@Arie\_J\_Godschalk](https://community.homey.app/u/Arie_J_Godschalk)\
**Post date:** [March 18, 2023, 11:45am UTC](https://community.homey.app/t/how-to-evaluate-trigger-when-cards-with-arguments/77965/3 "2023-03-18T11:45:48Z")

</div>

Yeah, in the runListener you need to compare args.minutes with state.minutes.

---

<div class="post-metadata">

**Author:** ![OH2TH](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/oh2th/32/111414_2.png) [@OH2TH](https://community.homey.app/u/OH2TH)\
**Post date:** [March 18, 2023, 1:08pm UTC](https://community.homey.app/t/how-to-evaluate-trigger-when-cards-with-arguments/77965/4 "2023-03-18T13:08:24Z")

</div>

Thank you, now I got it, indeed there can be runListener for triggers also and was documented quite well in:

> **[Arguments](https://apps.developer.homey.app/the-basics/flow/arguments#flow-state)**
>
> Flow arguments allow Flow cards to ask for user input.
