How can I setup recursive logic? Say I have A...

(Grant Stead) #1

How can I setup recursive logic? Say I have Accounts and Sub-accounts. I want all of these in a single table because “parent” accounts are chargeable if they don’t have sub-accounts, and typically the parent accounts are NOT chargeable and the sub accounts are chargeable if there are sub-accounts.

So, when recording expenses I want the user to be able to choose the proper account with a REF field so that the expenses show up under that account as child records. (This will only show the users list of chargeable accounts.) So there will be a mix of parent-account and sub-account…

How do I achieve this?

(Reza Raoofi) #2

Self-reference seems to work in AppSheet; how many nested levels are you talking about though?

(Grant Stead) #3

@RezaRaoofi I swear I tested this early on, and got nowhere… But I’ve been playing with it all morning, and it seems to work fairly well, you just have to manually create the REFROWS…

(Grant Stead) #4

@RezaRaoofi how do you think I would be able to tell with an expression what level the recursion is at… Root level 1, level 2, etc…