var name = PUT_YOUR_NAME_HERE var name_array = name.split(" "); console.log (name_array + " " + name_array[name_array.length-1] )
What the code above do is to pick a full name and transform it in a Array, using the blank spaces between the words as separators. In the end, the code dysplays the FIRST and LAST element of the Array.
So a name as “Barack Hussein Obama” will create the Array:
var name_array = ["Barack", "Hussein", "Obama"]
name_array is Barack
name_array[name_array.length-1] is Obama
So, using Toolbox plugin, you can extract the result and post it back into Bubble. Very simple.
Hope it helps someone!