I’ve created a few different form components. What is a simple way to access the input values for each of the form components outside of the components? I need this to submit to an api and can’t find a way of exposing the values?
I know you can use triggers but that means I would need to create an external variable for every component which does not make sense.
when you trigger an event you can add a payload that can be used from outside the component. The payload can be any value, so you can bind it to an object with the values of the inputs
So when say field is changed essentially you store event value to the trigger event and then on the outside run a trigger workflow to store this to an external object?
I have several input components so I would have to store all their values to an object on trigger. In the event that one field is not edited I would need to lookup the initial value to get the initial state. It seems like a lot of work that could be solved by enabling some exposed variables per instance
triggers don’t store anything, they are just messages with payload that can trigger a workflow set from the parent of the component. It’s a way to communicate from child to parent. When/how/what to communicate it’s up to your logic.
I don’t know your use case but as an example of component with multiple inputs I would create an internal variable as an object with the values of every input. On change of every input I would update the corresponding property of the variable, then trigger an event with the variable as payload if you need to let the parent use the data. Maybe trigger another event on submit/click of a button.
Can you take a look at my posts here, still trying to fully grok if / how a component trigger can be used outside the component - > Trigger Component - #7 by Broberto
components triggers needs to be triggered from inside the component and can be listened from the parent of the component. It’s communication from child to parent, not the other way.
If you have some logic defined inside the component and want to trigger it from the parent you need to use actions, but this is not possible right now. It should be planned so you will be able to do it.