Welcome to the forum
Which bit of the flow is not working as you expect? Use debug nodes to find which node is not doing what you want. Give the debug nodes names so that you can more easily see which is which.
If you still can't get it working then post the flow here and tell us which node is the problem, show us the debug showing the inputs and output of that node. See this post for how to post a flow here - How to share code or flow json