How to filter based on field with variable value

I have a simple flow that connects an app to itself. When a new task is created, the flow triggers and adds data from that task back into the task name (ie, the task id is added into the task name) - this works beautifully and has made life much easier for staff and clients.

The hitch came this week on a repeating task, each time the task is completed, it creates a new task and appends the task ID….but the previous task already had its id in the name…so after repeating a couple times I have 5 task ids in the name of this task and I have a mess (ex: original task was “Create new…” - automation turned it into “456 - Create new…” and after the repeating a few times I have: “1234 - 876 - 456 - Create new…”

I want to create a filter between my two steps, but how to I filter out any task that already has an id, without it being a specific #? Think, anything that starts with “### - “ - I want to remove the “### - “ and replace it with my new task id instead. Any ideas?

Hi @beth17m,

This seems like a problem that we can solve using some replace functions together with some if and contains functions for filtering.

I think I can come up with a solution, but I just need some extra context.

  1. Is the number created in front of ‘Create new’ always a 3 or 4 digit-number?
  2. Is the number always separated with a space, a ‘-’ followed by another space?

Also, you might have a look at the following documentation from Make: String functions - Help Center

The situation you describe desires a solution that should work for all numbers, as you describe in your last paragraph. The documentation above might come in handy, especially this part:

Hope this helps - VDW

1 - the # is always an 8-digit # (it’s the task ID inside the App I’m using so it ticks up….eventually it could hit a 9 digit #, but we have plenty of time before that happens)

2 - yes, my flow appends the 8-digit # and the space-space in front of the task name, thus I need to test to see if the task already has this # and space-space. If it does, I need to remove it and replace it w/ the new task id and space-space

Does the replace part allow for wildcards or placement specific? For instance, I wouldn’t want the replace to replace ALL numbers in my task name, only those 8 digit# followed by the space-space….any other #s in my name should stay.

Thanks for the help!

Beth

1 Like

I found a solution….I decided to add a “ID: “ to the front of our items too, so, “ID: ######## - “ – now, I can route new tasks based on the condition of starts with “ID:” – then the ones that do start w/ the ID, I filter out the beginning of the text with substring from position 12 to length (which strips out my ID and #s), then I append the new ID and # to the beginning of that.

3 Likes