Hey all, I'm working on my ShelterBuddy integration and the Name field isn't broken into First Name/Last Name.
Here's what it looks like:
"Owner": {
"Name": "Andrew Shanks",
"Uri": "/api/v2/person/xxxxxx",
"Id": xxxxxxxx,
"PrimaryEmail": "xxxxxxx@gmail.com"
}
I thought I could accomplish this with a List and try to use SplitBy but I can't really sort out how that works.
This is an issue when trying to create a new Contact since it's looking for the Last Name as a required field.
I could make a flow in Salesforce to split it once it's created but I'm hoping not to add extra automation into this if possible.
Let me know if there's a way to accomplish this in Composer!
Shenoy Meghesh Umesh (Deloitte Digital) Forum Ambassador
- Create 4 variables each one storing FirstName , lastname , loopCounter ( value set as 0 ) & NameList
- Right before making the callout use the update variable block
- In here update the NameList variable and use the Custom Expression Editor
- Use splitBy( The Field Containing name , )
- There is a space after comma
- Now Use the For Loop element and loop over the NameList variable
- You can use the if else block inside the loop
- Set the condition as
- If LoopCounter is 0 then use Update Variable block to update the firstName variable with The current Item in loop
- If LoopCounter is 1 then update lastname Variable with the currentItem in loop
- In both of these update variable block please add +1 to the LoopCounter variable
- LoopCounter variable + 1
- Because you are explicitly controlling the loop
- Now you have the firstName and lastName stored inside
- You can use these while creating records in Salesforce
Thanks