benaust
October 15, 2022, 12:09pm
1
I am trying to combine two variables in on Label
e.g Column 1 (FirstName) Column 2 (Last Name)
Display this in label widget as Ben Smith
Below brings it out as two lines instead of one
{{
get_client.data[0].client_firstname;
get_client.data[0].client_lastname
}}
Hey @benaust - here’s a few ways you can achieve this.
Join with +
inside the {{
}}
binding:
{{ get_client.data[0].client_firstname + ' ' + get_client.data[0].client_lastname }}
Use two different bindings, separated by a space, outside the bindings:
{{ get_client.data[0].client_firstname }} {{ get_client.data[0].client_lastname }}
Use a template literal :
{{ `${get_client.data[0].client_firstname} ${get_client.data[0].client_lastname }` }}
Thanks GreenFlux
First and third option worked like a charm. The second one came up with “undefined”
Regardless, the two options are plenty and working.
Thanks