Field in Tab Name

  • 1
  • Question
  • Updated 3 years ago
  • Answered
I'm creating a timesheet application and I have a tab set that has tabs for each day of the week (Mon-Sun). I have the tabs named Monday, Tuesday, Wednesday, etc.., but I would like to also include the date which belongs to that particular day of the week. Is there a way I can add the date field from my model into the tab name?
Photo of Colby

Colby

  • 614 Points 500 badge 2x thumb

Posted 5 years ago

  • 1
Photo of Rob Hatch

Rob Hatch, Official Rep

  • 44,006 Points 20k badge 2x thumb
The secret is that the Tab Label field will accept template syntax allowing you to get at data within your Salesforce Instance. So you can use {{ double brackets }} to your hearts content.

There is a catch.

Since Tabsets are not related to models they don't automatically know where to fetch your data - so you need to use the following syntax:

{{$Model.ModelName.data.RowNumber.(FieldName)}}

Where "ModelName" is the model name you provided in the page builder and "RowNumber" is an integer (1, 2 etc).

Hope this works for you.
Photo of Jacob Flatter

Jacob Flatter

  • 1,512 Points 1k badge 2x thumb
Found this after posting a similar idea, can you include the field selector on the tab label field to show the Admin-User this capability?
Photo of Jacob Flatter

Jacob Flatter

  • 1,512 Points 1k badge 2x thumb
Also, any clues on showing a Count of rows in a model?
Photo of Rob Hatch

Rob Hatch, Official Rep

  • 44,006 Points 20k badge 2x thumb
Good question that merits is own answer Please reference the new topic here: Can I show Number of Rows in Model in the Tab Name?
Photo of Dave

Dave

  • 5,538 Points 5k badge 2x thumb
Hi,

I'm trying to add a field's data to the tab;s name.

Following example above, but still no result.

Can anyone help by any chance?

Model:Bank_statements
Field:of_active_online_access__c
Row:1

{{$Model.Bank_statements.data.1.of_active_online_access__c}} 

Thx
Photo of Pablo Martinez

Pablo Martinez

  • 2,468 Points 2k badge 2x thumb
How many records have the model? this syntax is 0 based, so, the first record is 0, second is 1,...

so if you only have 1 record: {{$Model.Bank_statements.data.0.of_active_online_access__c}} 
(Edited)
Photo of Dave

Dave

  • 5,538 Points 5k badge 2x thumb
Thank you very much that worked!

Happy Thanksgiving :)