Expand my Community achievements bar.

The Community Ideas review for H1 2025 is out now, see which ideas our Product team prioritized and let us know your thoughts.
SOLVED

Fusion Grandparents search

Avatar

Level 2

Hello,

 

I want to take a certain action on the lowest sub-task given a higher parent within Fusion. When the task I am looking for is directly underneath the parent task there is no issue getting this information with a quick search within Fusion. However, in some cases I have multiple layers between one another where the search is on a grandparent task instead on a direct parent. For instance, I can have different layers such that:

 

City X

                  Restaurant 1

                                    Table 1

                                    Table 2

                                    Etc.

                  Restaurant 2

                                    Table 1

                                    Table 2

                                    Etc.

                  Restaurant 3

                                    Table 1

                                    Table 2

                                    Etc.

City Y

                  Restaurant 1

                                    Table 1

                                    Table 2

                                    Etc.

                  Restaurant 2

                                    Table 1

                                    Table 2

                                    Etc.

                  Restaurant 3

                                    Table 1

                                    Table 2

                                    Etc.

 

If I want to write an action on the tables based on a given restaurant this can be easily facilitated by searching the table within the restaurant. However, if I want to take an action on all "Table 1"s for all the restaurants within a city I have no direct parent relationship. Is there any way to skip layers between the task I want to do the action on and the task that triggers the action?

 

I cant quite figure this one out so thank you in advance!

1 Accepted Solution

Avatar

Correct answer by
Community Advisor

Hi @NCorver 
Thank you for sharing! 
So I see two ways: 

  1. in your search, if you use the custom API module, you can say e.g. 
    parent:parent:name = XYZ
    OR:1:parent:parent:parent:name = XYZ
  2. Add a hidden (admin only) calculated field to the grandchild/great-grandchild tasks with the correct parent ID
    IF(ISBLANK({parent}.{parent}.{parentID}), {parent}.{parentID}, {parent}.{parent}.{parentID})​

#2 might be preferable because then you have the ID right in the event bundle.

I can't tell if you really need to access the (great-)grand parent tasks since you only mentioned closing what I understand to be sibling tasks. If you only need to operate on siblings, you can pull {parent}.{tasks} of the task that triggered the event.

Hope this helps!

View solution in original post

9 Replies

Avatar

Level 1

@NCorver Do you want to search into the list of tasks, right? 

 

Did you use the search module for the tasks? 

 

Avatar

Level 2

@DimitrisGoudis yes, I want to search for a list of task dependent on a higher level parent.

 

I have used the search module but my issues is that I only know how to refer to the parent that is directly above the task I am searching for. When I want to refer to parents that are X amount of higher levels, I do not know how to configure this in the search module. 

 

Avatar

Community Advisor

I can't tell what your usecase actually is (in the sense "when event X occurs I need to do Y")

 

So in general, you can refer to up to 4 levels of hierarchy, e.g. the name of the task's grandparent is parent:parent:name

 

In the search module you'll need to click the map button and manually enter this - you can use the "references" or "collections" section to do this.

 

There may be a better approach - can you explain your usecase? 

 

Avatar

Level 2

Hi @Sven-iX , 

 

Thank you for your reply! I will definitely try to get this to work as this seems to be what I was looking for. Also makes sense why I could not find it in the options of the list in the module.

 

As per my use case specifically it involves three hierarchies where certain tasks need to be deleted/marked as complete based on input. So to further elaborate I have the following structure:

 

Grandparent: Product code of Product 1

  • Parent task
    • Task X
    • Task Y
    • Task Z

Grandparent: Product code of Product 2

  • Parent task
    • Task X
    • Task Y
    • Task Z

Both products have to follow a certain step by step creation process where the process is always the same. However, based on business prerequisites sometimes a product can already start with task Z as the previous tasks have already been done but in some cases the product has to start a new with all the task yet to be filled out. So either I want to delete Task X and Y for the products it is not relevant for, or mark them as complete as these steps are already been done before. With the unique identifier in this set-up being the product code that determines which steps are relevant.

 

I hope this helps with the use case, if you have further question, please let me know. 

Avatar

Community Advisor

Hi Niels

  • what would trigger your scenario? 
  • the task structure is ALWAYS only 2 levels deep? 
  • how is the parent task to operate on identified?
  • what does the scenario do - create the project and do the cleanup - or is this cleanup while the project is inflight?

 

Avatar

Level 2

Hi @Sven-iX,

 

Fair questions I will try to answer them all.

  • The scenario will be triggered by additional issues that get resolved to trigger the workflow. I am combining templates to create a step by step process of creation of product based on set creation steps. But the template I attach for each product shows the full task tree whereas sometimes the first few tasks have already been done as the product may be a variation of an already existing product.
  • In reality the task structure can be both on 3rd and 4th level so no its not always at the same level. I got rid of an extra level to not make it more difficult than it already is. Hence also why I need an easy way to search for grandparent tasks given a certain lower level task without having to search through the whole tree individually. I.e. search parent of level 4 task, search parent of level 3 task, search parent of level 2 task, then use this identifier to make sure the automation only runs for that parent ID.
  • The parent task contains a product number which can be used to identify a certain product.
  • Project creation is already done at an earlier stage with a different fusion workflow. This workflow aims to gather the tasks needed per product code to show the project owner the steps that need to be done to create all the products requested. Basically, this part of the workflow is the clean-up of the general project structure.

 

I hope this answers your questions, feel free to ask more if needed!

Avatar

Correct answer by
Community Advisor

Hi @NCorver 
Thank you for sharing! 
So I see two ways: 

  1. in your search, if you use the custom API module, you can say e.g. 
    parent:parent:name = XYZ
    OR:1:parent:parent:parent:name = XYZ
  2. Add a hidden (admin only) calculated field to the grandchild/great-grandchild tasks with the correct parent ID
    IF(ISBLANK({parent}.{parent}.{parentID}), {parent}.{parentID}, {parent}.{parent}.{parentID})​

#2 might be preferable because then you have the ID right in the event bundle.

I can't tell if you really need to access the (great-)grand parent tasks since you only mentioned closing what I understand to be sibling tasks. If you only need to operate on siblings, you can pull {parent}.{tasks} of the task that triggered the event.

Hope this helps!

Avatar

Level 2

Hi @Sven-iX,

 

Thank you for the quick reply! The second option feels like the most sustainable one that I didnt think about earlier, great insight. This way they are included in the bundle indeed and I can reuse the ID later down the line in my fusion flow. I already tried this and it works as intended.

 

One more question just to make sure; this logic of using the parent.parentID cannot be reused in the search module correct? If I try this the module tells me it does not support the field, which makes sense otherwise it would be in the list of options. I just wanted to double check with you to make sure.

Avatar

Community Advisor

Hi @NCorver 
the search module is a "user friendly" module - and no you couldn't search by that. You'll need to use the customAPI module. 
In the module you'd add query arguments to match you search.

 

Note if you need to you could add another level 

{parent}.{parent}.{parent}.{parentID}