Help with copying data

Hello guys, so I am having trouble with the following:
I created “task plans” for my users that are structured as followed: thing: PLAN; field: List of TASKS. TASKS among other fields have one which is date.

So my main problem has to do with date. As a plan there is an order in terms of date for tasks: 1st is current date, 2nd is current date plus 3 days, and so on. The problem is that since I am copying the tasks from a plan, directly from the database the dates are already set and I want the dates to start from current date. If I have say 1 plan with a few tasks I can easily create a workflow to Make changes to list of things. But what if I have 10 different plans with dozens of Tasks??

Is there an easier less complex way to do it? Or maybe a way to store actions in the database??

Thanks in advance

Take a look at the question I just asked Save Lists of Things to list of Texts with suffix because I solved it and I think it is what you need. If you can follow. The key is to call a “Backend WorkFlow on a List of Things” and within that workflow have an action that does the date adjustment you want on a single thing. The Backend Workflow will run as many times are there are things (tasks or whatever list you pass to it).

thanks for your reply Patricia. I will have a look into that

I am not sure I understand the solution you propose.

I’m not sure I understand it well enough myself to explain it but I did find that using Backend Workflows (previously and still in some places called API Workflows) you can run something on a list and I wanted to do something not unlike what you describe. I got it working with lots of experimenting but I’m not 100% sure how/why only that it does.

To be perfectly honest, I would be unable to do what I can today if it were not for @gaby. I did her Fast Track course which gave me a great jump start and I subscribe monthly to her VIP knowledgeable and use it extensively. She is excellent at explanations - the best I have found.

1 Like

And where do you you use those workflows? In any page or a specific one?

On the page, where you currently propose a workflow to change the dates on a small list of tasks. That is where I would tend to put it, based on my limited knowledge of your app. That may be when things are being saved or loaded, I don’t know where you do this function.

I studied my workflows again and here are a few things that may be important to understand.

  1. Go into Backend Workflows and create a New API Endpoint, give it a name and manually [Add Parameter] and specify that you are sending a single Project.

  2. Inside that API Endpoint add whatever actions you need e.g. Do for all tasks, task date=date+3 days.

  3. On your page Schedule an API/Backend Workflow on a List and pass your list of projects as a parameter.

I hope this helps. I’m not really proficient enough at this list stuff to be clear but explaining it is helping me understand it.

1 Like

Hello @patricia,
I found a solution that suits my problem and does not require backend solutions.
I have created a field in tasks called days (number) that relates to how many days aways from the first task that task is. So All I have have to do is copy list, then make changes to list and say date is current date plus days (field:days).
And the frontend is quite simple aswell:
1- A repeating group showing all task plans.
2 - A second repeating group inside a group, showing tasks. The reason for it to be inside a group is so that once I click on a plan cell it sends that cell plan into the group. Then the second repeating group shows tasks in which the plan in parent group plan.(This is only for user experience so the user can review all tasks and opt to choose that plan or not)
3- Then in order to add those tasks into the other thing I want, I copy that list of tasks (do search for tasks in which the plan is the one in the last group) and make the changes. I found this very useful and it doesnt require a lot of usage. Maybe it can help you asewll.

1 Like

Nice solution @paulogustavopeixoto, you recognised that you had “calculated data” and separated it from storage :smiley:

Be aware that there are some gotchas around timezones, daylight savings, etc. with adding days.

1 Like

Thanks @mishav
In my case timezones wont be a problem. But appreciate your advice.

And also I believe that the biggest gain is that if I have dozens of plan tasks it simplifies the process of duplicating them in terms of workflow. With one workflow I can duplicate as many lists as I want, because all of them have the same set of principles.

1 Like

Now I understand what it was you were trying to do, doing it as you have makes a lot more sense. I thought you wanted to change the dates in your database since you referred to database in your question.

What I have is a set of tasks created by administrator that point to a task plan and eveytime a user wants to use that task plan it what I want is to duplicate them. Butthe dates need to be current

Ah got you now. Like a template of tasks and you want to set the dates when an instance of that template/plan is created. I get it now.

1 Like

Spot on