I'm pulling in a field from Salesforce to Marketing Cloud from the Campaign Member object. The Campaign Member field points to a sales user who is assigned to the Account of the Campaign Member.
I'm referencing the "Full Name" field in the User object and I get a value that is: "LastName, FirstName"
Is there any way to flip the name to be "Firstname Lastname" with AMPScript? I can do this in Javascript like so:
var name = "Donald, Duck D".split(",").reverse().join(" ").trim();
if(name.split(" ").length > 2) {
name = name.split(" ");
name.splice(1, 1);
name = name.join(" ");
}
document.write(name);
Is there any other way to do this via AMPScript?