Pricing Blog

Custom Action Output Value for Use in a Variable - Current Window Width

  • matthewcc119-1391241429887750144

    Matthewcc

    6 days ago

    I’m trying to run a script inside a custom action that outputs the current window width. Getting that value in a script is straightforward, but I’m having trouble assigning that value to a variable in Nordcraft outside the action so that I can use it in a formula. Is there a way to do this using an event that I might be overlooking? I need the actual window width, not just the trigger, because I need to use it in a calculation. I’d appreciate any insight!
  • lucasg-1391246871070248993

    Lucas G

    6 days ago

    Pass it back via the regular custom action events, unless I'm misunderstanding the question here
  • ctx.triggerActionEvent('eventName', eventData)
  • You could also use a custom formula and use its value directly in your calculations
  • matthewcc119-1391428255596150835

    Matthewcc

    5 days ago

    Thanks for the help. I had my action coded correctly, I was just not properly using the event value in the formula to assign the value to a variable. I was assigning the event -> target -> value when all I needed was the event. Screenshots for anyone else trying to figured this out in the future.
    1391428254099046531-Screenshot_2025-07-06_at_10.35.21_AM.png
    1391428254690185286-Screenshot_2025-07-06_at_10.35.48_AM.png
    1391428255202017343-Screenshot_2025-07-06_at_10.36.21_AM.png
    1391428255655133234-Screenshot_2025-07-06_at_10.36.03_AM.png
    👍1