Webhook Data - Filter/Repeating task for collection

Hello All,

I have a webhook that is passing a series of contact fields from a form. The form allows for up to ten contacts to be passed to the webhook at time, but does not validate the entires. What is the best way to loop through this webhook, being that it is a collection, to check that at a minimum, each contact has a phone number? If the contact does not have a phone number, i would like to eliminate those fields from the scenario. i.e. remove contact3Name, contact3Phone, contact3Zip, contact3Brand etc etc.

Basically, I would like to filter out any contacts who do not have a phone number and I am unsure as to what module or process would be the best to go about doing so. Could this be filtered into an iterator or a repeater etc.

Thanks in advance for the help!

You can make your collection go through an iterator after you convert to an array.

toArray() will help you.