How to structure a "recent comments" view

I want to create a new tab for “manager” users that shows recent comments across a number of parts of the app.

  • Managers oversee certain users
  • Users can add comments to various tabs, such as TASKS and EVENTS
  • I want to create a view that allows managers to view recent comments across different tabs for the users the are responsible for. Easy so far
  • Each comment in that view should include a link to the view page for that item

It’s that last part I cannot fathom. I don’t really understand Glide’s url structure . I was saving the “page url” and having that as an open link action, but that doesn’t seem to be the right approach.

I can probably get away without the link just showing titles. It would definitely be easier to have a link though, and I want to do something similar with an events log, so was interested if anyone else does anything like this.

To clarify, let’s say you have comments on Page A and Page B.

Managers have access to Page C that has a list of recent comments from A and B?

If so, you want to allow managers to click a comment and get redirected to either Page A or Page B (where they’d see all comments on that page)?

Yes - exactly that

Got it…

Record the RowID of each page every time there’s a new comment. From the comments tables, create relation columns that relate this RowID back to the parent screen. Create an action on the manager screen that performs a View Details Screen → Relation (not “This item”)

1 Like

Sounds logical. I’ll give this a shot, thanks

1 Like

No problem. Let me know if this works for you.

Actually, what you describe is what I was trying to do. I am still stuck though on how to achieve the following:

From the comments tab, create relation columns that relate this RowID back to the parent screen

I could create a relation from comments back to A (examples “Tasks”) or B (ex “Goals”) but I don’t see how I can relate back to either A or B in the same column. Am I missing something obvious.

I’m starting to think that I have maybe made some fundamental errors in how I structure this app due to not properly understanding the tabs/screens concept.

Sounds like you’re using a singular comments table for all comments across the entire app?

Ya…in that case it’ll be a bit less dynamic. You’ll need to create multiple relation columns to the respective tables and then create an action with conditional branches that check against each relation to see if it’s “not empty” and if so, view details for that relation.

A more dynamic approach (but slightly poorer UX) would be to write the deeplink for each Page when a new comment is created and then when a manager clicks the action button, perform an open link action to that deeplink. The only caveat is that it will open that page in a new tab :confused:

Yes, currently a single comments table. My thinking was this would be easier as I could then view them all in one list. I am already storing the full URL. I spotted the new window thing. That’s a little annoying, but I could live with it. It still doesn’t quite work though - my “not very glidey” structure.

I don’t want to rebuild at this stage. I might switch to sometime simpler and ponder it for a bit! Thanks for your input

Just updating in case anyone has the same challenge later. The solution works. It feels rather inelegant and redundant, but I am learning that duplication is often the answer in Glide. It’s hard to break the habit from SQL days of that being a bad thing.

What I did…

  • Stuck with a single column table
  • Added and Row and Title column for each type of content that accepts comments (ie Task-Row, Task-Title, Goal-Row, Goal-Title etc). Title is a lookup from Row
  • Added a comment type (task/goal etc) column
  • Create an Active-Row if/then column to give me one place to look for rowID whatever the type
  • Create an Active-Titel if/then column to give me one place to look for the title whatever the type

The above allows me to have one list of all comments and see what the comments relate to.

  • Then added an action that was a nested if/then based on comment-type . This created the correct type of view-detail action, which I could put on the row.

It’s a bit clumsy looking, but it definitely works as intended. @Robert_Petitto 's comment earlier in this thread about performs a View Details Screen → Relation (not “This item”) was the key to me taking this approach, so thanks for that!

1 Like