$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 🥲 )
![No description](https://answer-overflow-discord-attachments.s3.amazonaws.com/1160003201349730374/image.png)
![No description](https://answer-overflow-discord-attachments.s3.amazonaws.com/1160003201592987718/image.png)
16 Replies
For starters you’re not returning anything in defaultItems()
Omg really ... 💀
Ok its not that
![No description](https://answer-overflow-discord-attachments.s3.amazonaws.com/1160007783236772001/image.png)
Still nothing
![No description](https://answer-overflow-discord-attachments.s3.amazonaws.com/1160007830791786496/image.png)
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
![No description](https://answer-overflow-discord-attachments.s3.amazonaws.com/1160008571405213736/image.png)
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