$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
No description
16 Replies
awcodes
awcodes2y ago
For starters you’re not returning anything in defaultItems()
Chriis
ChriisOP2y ago
Omg really ... 💀 Ok its not that
Chriis
ChriisOP2y ago
No description
Chriis
ChriisOP2y ago
Still nothing
No description
awcodes
awcodes2y ago
Just the first thing that stood out to me.
Chriis
ChriisOP2y ago
Yeah, I have a bad habit with afterStateUpdated where you return nothing but you have a $set
awcodes
awcodes2y ago
Also, defaultItems only works in the create context.
Chriis
ChriisOP2y ago
Yep, so it should be good because this go into my CreateSheet page
No description
awcodes
awcodes2y ago
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.
Chriis
ChriisOP2y ago
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
awcodes
awcodes2y ago
Have you tried using ../ ie path based $get.
Chriis
ChriisOP2y ago
Yes but I think I don't really understand how it works and how I should apply it in my case
awcodes
awcodes2y ago
So if step one has a field named title. In step 2 try $get(‘../title’) It’s similar to directory based paths.
Chriis
ChriisOP2y ago
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 😦
awcodes
awcodes2y ago
Hard to say. Something seems off though. The state or the form is the state and it should be traversable:
Chriis
ChriisOP2y ago
Yeah ... idk

Did you find this page helpful?