Why Does Code Involving 'Trigger' Crash Even Though IDE Validates It and Workarounds Stop The Crash?

This topic was automatically generated from Slack. You can find the original thread here.

Found something that’s really been bugging me :drum_with_drumsticks:

Photo 1: When I reference ‘trigger’ in my code step/prop, the code crashes saying it can’t read from the trigger because it’s undefined.

Photo 2: Weird workaround, if I define a prop that takes in steps.trigger… it returns the text just fine.

Photo 3: Clearly even the IDE thinks that the trigger is valid, its showing me what’s inside of it when i hover over the trigger call.

To top it all off, this was working fine for the longest time and now it just does not work. I’ve tried deleting the code step and putting the code in a fresh code step, but the problem still persists. I’ve tried taking the code out of the prop and putting it inside of a code step, and the problem still remains. Can someone tell me why this happens? I remember this used to be an inconvenience a few months ago, but back then I’d maybe put the code in a new code step and it worked fine. Buggy, but fine. However, this is not the case now. And I don’t wanna create a new flow if I can avoid it.

, could you share a minimal example to reproduce your issue (Similarly to the image below)?

From you message, I have a light grip of the issue, but I couldn’t figure out how to reproduce it. If you can share the minimal example, it would be a great help

that’s my point, you shouldn’t be able to reproduce the issue, i’m not able to either! But I actually did some reading in the bugs channel, it seems according to @U02SX7ETBFB that you cannot reference ‘steps’ inside of PD Actions, and i will have to create a prop for it anyway. Can you confirm whether this holds true for PD actions

Yes it’s true that you can not reference steps in pd action

You will need to use prop

is there anyway to hard code/pre-fill the text field of a text prop?

You can use environment variable: Environment Variables.