Open details page of specific item in multiple relation list

I have table of Devices that each have several Test Results in a different table. On the Test Results table, the most recent test result for each device is flagged. I am trying to implement a button that will link from the Device page to the details screen of the most recent Test Result for that particular device.

I have tried creating a multiple relation column in the Devices table, and linking it to the Test Results table by unique ID. I then set up a button to Link to the relation. However, the screen that appears presents only the first match, and does not have a “features” tab and therefore no ability to filter by the Most Recent Flag.

Thanks in advance for any help!

If your most recent test results are at the bottom of the table you could try using a single value column in the Glide Editor to pull the last entry.

1 Like

You can set the ID of the latest Test Results in Devices table when you are flagging the test result. This will Device row will always have the ID of the latest result to link to.

1 Like

I would create a multiple relation from Devices to Tests. Then create a single value column (whole row) against that relation to get the last result entry. Then point your button’s Link to Screen action to that single value column.

5 Likes

Thank all for the help! @Eric_Penn alas the result was not necessarily at the bottom of the list. @Jeff_Hager your solution worked like a dream - thanks!

2 Likes

I have implemented that solution and found that it doesn’t quite work for my application. The reason for this is that sometimes the app is still waiting for our backend to post the latest Test results - and so either the button does nothing (if no Test results exist yet) or it links to an outdated Test result and does not refresh to the latest when the new Test results come in.

Is there any workaround for this? For example, by showing the latest Test result fields on the Device page directly?

You could set a visibility condition on the button to only show if the relation is not empty. That would take care of the situation where the button does nothing, by not showing it at all if there are not test results yet.

I’m not sure there’s much you can do about your second problem. Once you are viewing the details of a row, it’s not going to automatically jump to another row. There is one thing you could maybe do though. On your test results sheet, create a self relation to link the device id in that sheet back to the same device id in the same sheet. Then create a single value column that gets the last Test ID (assuming you have one…could be rowid). Then create an if/then column to compare the test row id to the single value row id. If they match, then it’s the latest test and you can return ‘true’. If they don’t match, then it’s not the latest test and you can return ‘false’. Then you can add Hint component to indicate that the test result they are viewing is not the latest when the if/then value is not true. So what I’m thinking, is that if a user clicks to view a test result for a device, then while viewing that test result another result is added, then it will change the latest test if/then to false and automatically make the hint notification show up, so they now that the results they are viewing are no longer the latest results. From there they can either go back to the device details and click the button again, or you could probably build in a relation on the test results screen to take them to the latest results.

To answer you last question, yes you could simply combine the true/false latest test logic from above and directly show the test results through a relation a lookups directly on the device details page. Or you could display an inline list filtered to just the latest (‘true’) results, but once you are inside the details from that inline list, you would still have the same problem if new results came in. The relation and several lookups would be better.

3 Likes

Thanks a lot @Jeff_Hager . Some really cool ideas in there. One clarification, in your final paragraph you mentioned “show the test results through a relation a lookups” - what do you mean by this?

Well, if you already have your relation and single value set up on the Devices sheet, you can create lookup columns to pull back each value you need from the latest test results into your Device sheet. Then display those values on your device details screen. Sorry, it should have read “relation and lookups”

1 Like

I never knew about the Lookup column. This is a gamechanger, and I think will enable the UX flow I am aiming for. Thanks a lot!

1 Like