Removing sections from text if they match criteria

Hey all,

I’ve been trying to send a list of available time slots as a webhook response. I have a long string of date and time slots for the following 7 days (currently in a Set Variable module). I also have an array of objects each with a date - representing the time slots that are not available - and I’m looking to remove the time slots that are not available from the original list.

The two challenges I’m facing is

  1. Segregating individual slots from the long list to be compared with the unavailable ones
  2. Comparing them and leaving out the ones that are unavailable

Any ideas on how I could get something like this going in Make? All inputs are greatly appreciated.

1 Like

Hello @GabrielC,

Did you get this solved?

I have a similar situation where I’ve two sets of data and I want the difference between them.

Conceptually, we iterate on the exclude data set, and remove that matching entry from the available data set. The trick is that you are getting and setting the available data set on each exclude data set iteration so that changes to the available dates are retained.

Let me know when you need a more concrete example. I’d be happy to do something using your data.

Hey @GabrielC

You need to convert the data to an array from where you want to remove unavailable slots. Then you can iterate array of unavailable slots and can use remove function like:

{{remove(array of all slots;value from iterator)}}

Regards,
Msquare Automation - Gold Partner of Make
@Msquare_Automation