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