Please help with a "logic" expression

Evening everyone,

Hereโ€™s one for someone looking for a brain teaser!

I havenโ€™t attempted the expression yet cause I havenโ€™t yet figured out the logic!

Hope someone can help?

Iโ€™m looking for the logic and an expression that will look at my survey table and identify the โ€œsharedโ€ cable routes into branches in the [branches] column.

Survey position 1 (red number below) is such a shared cable route example where I would use 1 survey form to capture all 9 cables in an EnumList in [asset_name] and an action would split the survey into 9 individual rows (each with one [asset_name] extracted from the EnumList.

The form does the EnumList thing nicely so donโ€™t need help with that.

The orange cables in surveys 1,2,3,6 would need to be Banch 1
The green cables in surveys 13,14 would need to be Banch 2
The blue cables in surveys 17,18 would need to be Banch 3
The remaining purple cables donโ€™t need branches.

Hereโ€™s the scenario:

Iโ€™m surveying a network cabinet, wi-fi points and cable routes in a building:

1 network cabinet (ZDC01)
9 cables (CAT01-CAT09)
9 wi-fi points (LPR01-LPR09)

This is a small sample. A full survey will have many more cabinets, cables and wi-fi points.

Thanks in advanceโ€ฆ

Hereโ€™s an extract of the survey table - though the data doesnโ€™t match the above example.

Solved Solved
0 13 343
1 ACCEPTED SOLUTION

Hi @Bellave_Jayaram,

I took the isPartOf question away and prodded it around a bit. From what I can make out - mostly because of the rigid nature of the rf_design table that underpins the app and itโ€™s โ€œunusualโ€ structure I figured that isPartOf wasnโ€™t going to fit. The rf_design table doesnโ€™t lend itself to Adds or Updates.

Having said that, isPartOf sounds exactly what I need for a sister app Iโ€™m starting imminently, where I have complete freedom over the design table - in fact, large parts of the design will be done on-the-fly and isPartOf sounds perfect for that!

This thread started with the issue of building โ€œbranch logicโ€ into the app and I think I now have a way around the issue. Thank you for for giving me the missing piece to my puzzle a moment ago over in Preventing an app formula / InitialValue firing when a row is copied.

Hereโ€™s how Iโ€™m working around the issue:

  • the survey form now allows the Surveyor to advise when a branch(es) is reached.
  • a computed branch number is allocated for the current and any other branches.
  • an EnumList assigns branching cables to the branch number
  • Selected items are subtracted from the initial EnumList of cables
  • as the survey progresses the current branch shrinks and knowledge of branch starting points grows
  • an XY map view presents Surveyor with all available (incomplete) branch starting points!

I still have a few corners to turn but this approach is looking promising.

Hereโ€™s a little preview for the survey form โ€œbranch logicโ€ workaround:

Cheersโ€ฆ

View solution in original post

13 REPLIES 13

No idea what any of this is but I am interested in the response.
So basically you want to know the optimal path to survey your items(in very simple terms)?

Hi @Austin_Lambeth,

Not so much the optimal path but looking to use the answer to reduce the number of photos shown in the post-survey report and itโ€™ll allow me to organise the information flow in the report. i.e. Iโ€™ll only need to show one photo per shared-cable-route-section and also present all the shared cable routes first, then all the single cablesโ€ฆ

The current report shows all of the CAT01 survey photos (up to 30) then all the CAT02 survey photos and so on so Iโ€™m ending up with a list of 100โ€™s of pages.

Bringing in the shared-cable-route thing should reduce the report significantlyโ€ฆ?

I would recommend use of multiple tables and relationships to do this rather than a single table.

Thanks @Bellave_Jayaram,

Could you give me a very brief outline of what the structure of that might look likeโ€ฆ?

You may be constrained by the business problem, I am not sure - you are surveying rather than planning a network design. Anyway, what I would suggest is to have a table for network Cabinets and have all relevant columns plus two related tables, Cables (child table with isPartOf set to TRUE) and Wifi Points (grandchild table). Cables may itself have a child table of Wifi Points with isPartOf set to TRUE. It then becomes easy to figure out the branches and what assets belong to each branch.

Hi @Bellave_Jayaram,

Iโ€™m surveying planned cable routes from a โ€œdesktopโ€ design. The survey is intended to validate the theoretical design.

Your proposal sounds interesting. Iโ€™ve not used that approach or isPartOf beforeโ€ฆ Iโ€™ll start reading up on it and will report backโ€ฆ Cheersโ€ฆ

Hi @Bellave_Jayaram,

Is there an AppSheet doc that discusses isPartOf that you could point me toโ€ฆ?

Iโ€™m looking but canโ€™t find itโ€ฆ?

Thank you Sirโ€ฆ

Hi @Bellave_Jayaram,

Iโ€™ve taken this from the Refs Between Tables docโ€ฆ

There are some limitations of which to be aware:

  • A table can only have one Ref column marked IsAPartOf (a row can only be a part of one other row).
  • Actions are not supported within forms. Inline views based on reverse references in forms will not display actions or trigger actions based on view events.
  • Canceling a form with pending line item adds/edits also cancels those adds/edits.

I currently use actions OnFormSave to take the EnumList in the form and use INDEX([asset_name],n) to extract the individual asset names as another action creates additional rows for each EnumList item.

I have it set up this way so that when I survey a cable route that has n cables in it, I only need to survey once and the actions then produce n rows.

Does point two above suggest that that may not work if isPartOf is TRUEโ€ฆ?

No, I donโ€™t think so. If you have relationships, you just have to make sure to populate the appropriate key to the parent table row in the ref column of the child table.

Hi @Bellave_Jayaram,

Thanksโ€ฆ Iโ€™ll give this a try and will report backโ€ฆ Cheersโ€ฆ

Hi @Bellave_Jayaram,

I took the isPartOf question away and prodded it around a bit. From what I can make out - mostly because of the rigid nature of the rf_design table that underpins the app and itโ€™s โ€œunusualโ€ structure I figured that isPartOf wasnโ€™t going to fit. The rf_design table doesnโ€™t lend itself to Adds or Updates.

Having said that, isPartOf sounds exactly what I need for a sister app Iโ€™m starting imminently, where I have complete freedom over the design table - in fact, large parts of the design will be done on-the-fly and isPartOf sounds perfect for that!

This thread started with the issue of building โ€œbranch logicโ€ into the app and I think I now have a way around the issue. Thank you for for giving me the missing piece to my puzzle a moment ago over in Preventing an app formula / InitialValue firing when a row is copied.

Hereโ€™s how Iโ€™m working around the issue:

  • the survey form now allows the Surveyor to advise when a branch(es) is reached.
  • a computed branch number is allocated for the current and any other branches.
  • an EnumList assigns branching cables to the branch number
  • Selected items are subtracted from the initial EnumList of cables
  • as the survey progresses the current branch shrinks and knowledge of branch starting points grows
  • an XY map view presents Surveyor with all available (incomplete) branch starting points!

I still have a few corners to turn but this approach is looking promising.

Hereโ€™s a little preview for the survey form โ€œbranch logicโ€ workaround:

Cheersโ€ฆ

Top Labels in this Space