Hey everybody! LONG time user, first time asker so I am hoping that somebody can point me in the right direction.
I am having some issues trying to display some data from a child table in my app.
I have done some digging around and I can’t find a solution, but I may be looking in the wrong areas.
I have a multi-destination booking app as the deliveries usually make a few stop overs.
In the main table/view, I have a column setup for Next Pick Up Address and Next Drop Off Address where I will need to display the relevant information from rows in my child table.
For example:
LEG 1
PICK UP FROM - 1A Fake Street, New York
DROP OFF TO - 56B Example Avenue, New York
STATUS - (Booked/In Transit/Completed)
LEG 2
PICK UP FROM - 56 Example Avenue, New York
DROP OFF TO - 1162 Sample Street, New York
STATUS - (Booked/In Transit/Completed)
If status = Completed for the first leg, I need the column(s) to show the information from the Leg 2.
Additionally, if possible, it would be great to be able to show the information from the FIRST Pick Up location and the FINAL Drop Off location displayed in their own columns as well.
I’m not sure if I am meant to do this via a workflow (by changing the values based on a set of rules) or if it is easier to do this through an expression.
Additionally, if possible, it would be great to be able to show the information from the FIRST Pick Up location and the FINAL Drop Off location displayed in their own columns as well.
I’m not sure if I am meant to do this via a workflow (by changing the values based on a set of rules) or if it is easier to do this through an expression.
If done by a workflow, the data wouldn’t update until the app syncs, so there’d be a delay. If done with an action, the data would update immediately.
I was assuming that the way around this would be to have a hidden column that inherits a value from the Enum list, but I feel like that might be the wrong way to go about it.
Additionally, if I was to allow say, 4 “legs” in total, is there a way that I can change this code to that application?
it won’t allow me to have my status column set as a enum or enum list.
Details? Is there an error? Can you provide a screenshot?
Ryan_Mortimer:
Additionally, if I was to allow say, 4 “legs” in total, is there a way that I can change this code to that application?
The code I provided doesn’t care about the number of legs, but I suspect it doesn’t handle how you have the legs of each trip described within a trip. Please explain how each leg is associated with a trip (parent/child?), and how you currently indicate that a given leg is the first leg, or that another leg is the third leg, etc.
Column Name ‘Pick Up From’ in Schema ‘VEHICLES_Schema’ of Column Type ‘Ref’ has an invalid app formula ‘=ANY( ORDERBY( SELECT( [Related LEGS][JOB ID], ([TRIP STATUS] <> “Completed”) ), [PICK UP FROM] ) )’. Cannot compare List with Text in ([TRIP STATUS] <> “Completed”)
and how you currently indicate that a given leg is the first leg, or that another leg is the third leg, etc.
Currently, I don’t have a “leg number” column, but this can be added.
The reason for this is that some deliveries are 1 leg, some are 4 legs (and everything inbetween)
This tells me the TRIP STATUS column is a list type, either EnumList or List. If so, 1) why???; and 2) replace ([TRIP STATUS] <> "Completed") with NOT(IN("Completed", [TRIP STATUS])).
Hi everybody! I am reviving an old thread as I have been trying to achieve something for the last 2 days.
@Steve (the legend!) has helped me out more than he probably realises with this. But what I am now trying to achieve is different values from different columns in the child tables.
But for the column you have this expression (Assuming Virtual column) you set the column type to list, base type to ref, and reference to your “LEGS” table.
Then let me assume this column is named to be [VirtualColumn1]
Then this create another column and push expression for de-reference list
The child rows have data that is inherited by the parent.
The parent row has data that needs to flow back based on the “status” of the related Child record(s).
Works in the fact that it returns the LEG NUMBER - but I need to return the values of the LEG ETA, LEG REGION, DRIVER, etc.
PS: I have managed to create a string of expressions that are exploring the child records.
For example: I have a virtual column that can tell me what “leg” this job is currently up to, as well as another progress. So for example, there is a virtual column where in the example data provided above there is a return for “Current Leg” of “3/3”.
Also, I want to take this chance to say thank you for always helping out and pointing me in the right direction.
On the first virtual column you just simply get the list of IDs from your child table based on your condition.
Then use another VC to pull the list of value from this related child record using dereference list technique. If you want to apply sort, then sort this 2nd VC using SORT() expression, that s what I advised
Okay a quick update! So I went back to basics on this and looked at it from a completely different angle thanks to your suggestions.
I have created a virtual column that referenced the child table with the following expression for sorting and filtering: (Saving me from running the sort and filter expressions on every field I require).
Would I be correct in assuming that seeing as I have the sort feature on the [LEG FEED] virtual column, ANY() will select the first available child record - not a “random” child record?