Slice to show another slice or table in ref column

Hi,

I currently have two tables “Timesheet” and “Work Orders” and each of these tables have a slice “My Timesheet” and “My Work Orders”.

When I am in the slice “My Work Orders” or in the table “Work Orders” it has a Ref Column that links to the “timesheet” table. However what I would like to accomplish is that when I am in the slice “My Work Orders” it shows the slice “My Timesheet” and then when I am in “Work Orders” it will show the table “Timesheet”.

I am not sure where to begin.

Thanks,
Josh

0 10 1,582
10 REPLIES 10

I think we need more details on what you mean by this statement.

Maybe you mean when you are viewing a Work Order record it shows the RELATED Timesheet records?

And vice-versa when viewing a Timesheet record the app shows RELATED Work Order records?

Yes. That is correct that is what it does currently. However I use a slice to show me “My work Orders” instead of all “work orders”. What I would like to do is when I am in the “my work orders” view it shows a Ref column of “my timesheet”

In this screenshot it is showing the data of “my work orders” which is a slice. The ref column pointed to is of “timesheet”.

The problem is that it shows all timesheet records for this work order not just the slice of “my timesheet”.

However I still want the work order table to show all timesheet records of this work order when i am not in the slice of “my work orders”


This view is correct because it is of the data work order therefore i want it to show all related timesheet records for this work order

Essentially, I do NOT want to see everyones timesheet records when I am in the view of “My Work Orders” I only want to see my timesheet records. BUT when I am in the view of “Work Orders” I DO want to see everyones timesheet records.

Hopefully this helps clarify what I am looking to do.

Thanks,
Josh

I think I have it now. The last paragraph cleared it up.

I think what you need to utilize is a Security Filter on the Timesheet table - no Slice needed. I have not used them yet but from what I know it is extremely simple.

In the Security section, select the Security Filters tab, open the Timesheet table and insert an expression that will identify the rows for the logged in user. Viola! For each logged in user, they will only see Timesheet records that pertain to them.

You can be as complex as you need. For example, you may want Managers to see ALL Timesheet records so you can simply adjust your expression to identify which logged in users are Managers.

You can read more about Security Filters here:

As far as I am aware this does not solve my problem. Yes, it would stop showing me others timesheets but that would be app wide as far as I can tell?. I still want the ability to see others timesheets when I am in the work order view and not see others timesheets when I am in the myworkorders view.

Hi @Josh_Klassen,

I believe you may also wish to mention, whether you would like this behavior ( seeing only “my work orders” against all work orders) for all the users or only say managers or admins.

Also as discussed by @WillowMobileSystems, are you using security filters in your app

@Suvrutt_Gurjar

I am not currently using security filters in my app as of yet. However when I do use security filters I would assume I would be able to restrict the access of the “Work Orders View” to only certain users or user groups. However I would still want the view of “My Work Orders” to show the slice of “My Timesheets” instead of the inline view of “Timesheets”.

Hi @Josh_Klassen,

You may wish to try the following

This approach relies on use of USEREMAIL() to shortlist “My Work Orders” or “My TimeSheets”

Please create a VC called say [My TimeSheets]in the “Work Orders” table with an expression something like

SELECT([TimeSheet][Key Column Name of TimeSheets Column],[UserEmail]=USEREMAIL())

[UserEmail] is the column capturing user’s email in the “TimeSheets” table.

Here timesheet is the Reverse reference list type column in the “Work Orders” table whose screenshot you have shared.

The above expression will create a list of only those timesheets related to the user matching the
USEREMAIL()

Now in the slice “My Work Orders” , please use filter such as [UserEmail]=USEREMAIL()

In the slice columns , please have the [My TimeSheets] list column instead of the [TimeSheet] list column.
Edit: The above approach will display time sheet records related to only that particular user in the “My Work Orders” slice.
Hope this helps.

Hey,

That WORKED sort of…

As you can see in this screenshot it is showing three records in the timesheets ref view. Two are me and one is someone else. At the bottom you can see that there are 3 records to view. Then in the mytimesheets ref view it is not showing anything but yet there are two records to view.

Even when testing the expression it does bring back the desired result.

2X_6_6ef0cd9b1aef3d2a64b202e85e9ebe892acb3852.png

Any idea on how to fix this?

Thanks again,
You have been a great help so far.

Josh

Hi @Josh_Klassen,

Could you mention what happens if you tap on the View(2) button. Do you see the complete record? Also you may wish to check the name of table and detail view when you tap on View(2) for “My TimeSheets”.

There seems to be some challenge with the inline table view for “My TimeSheets” in your case.

I am able to see the shotlisted “My TimeSheets” records ( Image below).
The sample I tested has the same inline table view for "All TimeSheets"and “My TimeSheets” views. This TimeSheet table’s inline view is based on TimeSheets table and not on slice etc. Also there is no slice called “My TimeSheets” etc. on TimeSheets table. You may wish to verify your view configuration accordingly

.

Okay,

This is the view for “MyTimesheets” when clicking on the View(2) button.

And this is the view for “Timesheet” when clicking on the View(3) button.

This is the formula for the virtual column that is inside the “Work Orders” table.

Top Labels in this Space