And if I don't have a country, it should be United States.
00:20
So let me show you, how I set it up.
00:23
So first I took here, you know, same as you, query variable, default value us.
00:30
Then same as you, a country's variable.
00:33
And thanks for providing the context.
00:35
Actually really helped me debug this like super fast.
00:38
So thank you.
00:40
And then on a select element, so the options, I copy pasted, what you shared and I get the options, I get those three options.
00:54
So nice.
00:56
And then what did I do?
00:58
The value per item I same as you.
01:02
And what I changed is this.
01:04
so here is what I did instead, of going through js.
01:10
What I did is have a.
01:12
I did a filter by key on my country's, variable.
01:17
So filter by key is.
01:18
It takes an array, then you give it which key you want.
01:22
and the key I want is alpha 2 and the value is the value in my query variable.
01:33
So the query variable here af.
01:36
And then because like this is not going to be, I don't want to have this as a value.
01:43
I'll go and boom, get the first like the inside the object and then with dot notation get the phone code.
01:57
So that's how I get to 93.
02:00
And then I'll just concatenate a plus with 93 and I get plus 93.
02:05
So now if I go to deep like here, if I switched here, the select value is plus 33.
02:16
I mean, maybe you want some.
02:18
Maybe that's not exactly the.
02:21
Like, maybe you don't want this to be the select value.
02:24
Maybe you want the name of the country to be the select value.
02:27
And here to display 93.
02:31
In that case, you know, you'll want to change this and go with country code, whatever.
02:39
So, I'll let you figure this out to see what you want exactly.
02:42
but in any case, then if you switch to here, it should work in inside the editor, like it was already the case for you, but it should also work outside the editor.