[zTree Demo Flow]
[My Flow : AppendData Action]
I saw zTreeDemo and understood it.
I tried it once.
In addition to using the AppendData Action recursively like My Flow, is there a simpler way to
add menu rows to zTreeDataList
from data in the Menu Entity?
I converted the Menu list to JSON and put it in MenuListJson (data type: Text). Is there an easy way to use this, or
can I put the data from the Menu entity in zTreeDataList differently from the beginning?
Yes, there is a simpler and more efficient way to populate zTreeDataList without recursively appending each node—especially since you already have your Menu entity as a flat list and have generated a MenuListJson.
Build zTreeDataList in One Go (using Aggregate or Server Action)
Instead of building zTreeDataList through a recursive AppendData loop, you can use a single loop over the Menu list and construct zTreeDataList records directly.
Example Steps:
Fetch all Menu items into a local list (MenuList).
Use a For Each over MenuList.
Inside the loop, use ListAppend to add a new record to zTreeDataList:
id = MenuItem.Id
pId = MenuItem.ParentId (or however parent is stored)
name = MenuItem.Label
open = true or false depending on your tree behavior
This avoids complex recursion while still preparing a flat zTreeDataList that the zTree widget expects.