Skip to main content

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! 

6 Antworten
  1. Shenoy Meghesh Umesh (Deloitte Digital) Forum Ambassador
    9. Nov. 2023, 23:09

    Hi @Andrew Shanks

    1. Create 4 variables each one storing FirstName , lastname , loopCounter ( value set as 0 ) & NameList
    2. Right before making the callout use the update variable block
    3. In here update the NameList variable and use the Custom Expression Editor 
    4. Use splitBy( The Field Containing name , )
    5. There is a space after comma 
    6. Now Use the For Loop element and loop over the NameList variable
    7. You can use the if else block inside the loop
    8. Set the condition as
    9. If LoopCounter is 0 then use Update Variable block to update the firstName variable  with The current Item in loop
    10. If LoopCounter is 1 then update lastname Variable with the currentItem in loop
    11. In both of these update variable block please add +1 to the LoopCounter variable
    12. LoopCounter variable + 1
    13. Because you are explicitly controlling the loop
    14. Now you have the firstName and lastName stored inside 
    15. You can use these while  creating records in Salesforce

    Thanks

0/9000