Question

How to loop through list of home IDs and post to CRM field as separate items?

  • 26 September 2023
  • 3 replies
  • 40 views

Userlevel 1

I am confused about when to loop and how to use that loop once it is looped.

I have a step that is using python to retrieve home details via an api

one of the variables that comes back to me is this: 

 


Property Details Nearby Homes Zpid: 69164912,691649…548677,69169007


 

Which is a list of home id's of nearby sold homes

 

My next step is to take that and format it into a url, like this and post it into a field in my crm. I have five fields for comps, so I would do it for the first 5 numbers in that comma list above

 


https://www.xxxxxxxxxxx.com/homedetails/111725705_zpid/


 

I’m confused as to where to loop it at. If I put the loop after I have seperated it into line items it doesn’t show up as multiple items when I put it into the CRM

do I put the loop after I have formatted everything and achieved the final url I am seeking?


3 replies

Userlevel 7
Badge +14

Hi @JustJace 

Good question.

Please post detailed screenshots with how your Zap steps are configured to help us have context.

Userlevel 1

 

here is what I have right now, the part that matters is 7-10. 

 

7 is 

here is the action on 8

and here is the result

then 9 goes like this

 

with the output of 

the end result would be comp1-comp5 in my crm havint he first 5 urls from that  comma loist above

 

 

Userlevel 7
Badge +14

@JustJace 

You can use a Code step to take the list of Zips, then loop thru them to create an array of URLs.

Then you can have the Code step assign the first 5 items to 5 custom variables. (e.g. URL1, URL2, etc.)

Try asking ChatGPT for help.

That would replace the need for these Zap steps: 7-9.

You can then just map each custom variable to the desired field.

 

 

Reply