-
Notifications
You must be signed in to change notification settings - Fork 17
Get value from fallback field #20
Comments
Sorry @meyer59 I did't test it with a fallback field. But I am guessing it should work ok If you can make it work please let me know. Or feel free to send a PR with a possible solution, I will gladly take a look at your PR |
hello! so like at the moment the above will print either one of these cases:
so if you add a check for "defined" before printing, this workaround would print out only the locality when it's present, OR the postal_town when there is that one instead. p.s. thanks for this package! it really helped out a lot now that Nova Places is being deprecated. |
where exactly we have to put this defined check, will you please show me the code of that. i exactly want the same thing you mentioned above, if route is not defined then it shows undefined into concatination case (if i use {{parm1}} {{parm2}} it shows undefined if each of param is not defined) |
@asad-mytake facing the same issue when we add like {{route}} {{street_number}} in the AddressMetaField. So, if you resolved this issue or were able to find out any workaround then please share it here.
when route and street_number do not exist then it become show in the AddressMetaField as |
@asad-mytake I am sorry but mine was a suggestion to the package developer to introduce a conditional within its code, and skip the value when it's undefined rather than printing out "undefined". Unfortunately we couldn't find a solution achievable with code from our side. In the end we just decided to pull from the fields that are more commonly used in UK. |
Hello
Is it possible to get the value from a fallback field ?
For example: let's say you have a
state
field in your db, In the Google place response the state field is not always filled so you would rather fetch the value from theadministrative_area_level_1
.This could also be the case for the city: for some city the
locality
is filled and for some others thevicinity
is filled.It could be great if we can specify fallback field for the same db value.
Cordially
The text was updated successfully, but these errors were encountered: