$get doesn't work between Wizard steps
Hi everyone, I need help to understand why my code is not working. I'm using $get elsewhere without problems so I don't really understand 😦
Here is my code, the 'defaultItems' method get the 'days' from an input in the previous step of the Wizard. I want to generate a repeater block for each day.
Help would be really appreciated (I'm stuck on this since yesterday 🥲 )
16 Replies
For starters you’re not returning anything in defaultItems()
Omg really ... 💀
Ok its not that
Still nothing
Just the first thing that stood out to me.
Yeah, I have a bad habit with afterStateUpdated where you return nothing but you have a $set
Also, defaultItems only works in the create context.
Yep, so it should be good because this go into my CreateSheet page
In the edit context, it’s assumed that the values have already been Persisted to the record.
Ok, but I don’t know anything about your codebase, so all these methods mean nothing to me. Sorry.
Yes absolutely, I wasn't saying that in a bad way. I'm already grateful you try to help me 🙂
And I've tried to debug it but the value is always null
Have you tried using ../ ie path based $get.
Yes but I think I don't really understand how it works and how I should apply it in my case
So if step one has a field named title. In step 2 try $get(‘../title’)
It’s similar to directory based paths.
Ok
it also do nothing
Quick question, a TextInput->numeric() is still a string right ?
Yeah I really cant retrieve any data, I have tried with multiple input from the previous step and its null for everything its really weird 😦
Hard to say. Something seems off though. The state or the form is the state and it should be traversable:
Yeah ... idk