Expand my Community achievements bar.

Using A Checkbox Field To Decide Which Parent Tasks To Delete

Avatar

Level 3

Hello,

I am attempting to utilize a checkbox field on a custom form (on a project) to automate the removal of the unselected options. Each option in the checkbox field matches a parent task being used for the incoming project so a 1-1 relationship does exist there.

For example.
Checkbox Field Options:
1,2,3,4,5

Template Tasks:
1,2,3,4,5

If the incoming project has 1,3 and 5 selected then task 2 and 4 would be removed. I am trying to first get a record of each parent task in the project but don't see an option for listing out a projects tasks.

 

If it is worth nothing, each of the tasks I will be deleting is a parent task.

 

Thanks in advance!

-Eric

Topics

Topics help categorize Community content and increase your ability to discover relevant content.

4 Replies

Avatar

Level 2

You can use the template task ID to achieve the goal with a search module. So, just search using the template task id and it will bring you the id of the task that you need to delete

 

hope it helps

Avatar

Level 3

This worked for returning my parent tasks

P0oigSHdpy.png

 

My next step is how I can utilize a checkbox field to help decide which of these parent tasks to delete. The checkbox field and parents tasks match 1-1 so it's a matter of how to map those checkboxes to the parent tasks. Any help will be greatly appreciated.

Avatar

Level 2

1. Update the checkbox adding the template task id as a value

SebastianUndu_0-1711131429205.png

 

If you don't know how to get the template task id, go to the template

SebastianUndu_1-1711131506741.png

Select the task, and you will find the templatetaskid in the url

SebastianUndu_2-1711131609272.png

 

2. Get the checkbox (it will have the ID's that you don't want to delete)

3. Create an array with all the template tasks ID's

4. Iterate over the array, and compare if the array contains the ID, if it does, add a null and use a filter to finish the iteration, if it does not, delete. Something like this

SebastianUndu_3-1711132171240.png

And for the filter:

SebastianUndu_4-1711132232909.png

 


And that's it

 

 

Avatar

Level 7

Hi Eric,

I'm pretty new to Fusion (so others may have a better, more efficient solution), but I created a test project in our sandbox and was able to identify the parent tasks using a custom API module:

custom api parent tasks.png