F
Filament15mo ago
Chriis

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