Other Filters These filters provide a various utility roles in creating your lava. AddLinkTagToHead Show Details Server: v4.0 Adds a link to the HTML head of the current page. Additional Details Example: "CurrentPerson": { "PhotoUrl": "/GetImage.ashx?id=55" } {{ CurrentPerson.PhotoUrl | AddLinkTagToHead:'rel','image_src' }} The tag below will be added to the head of the page. <link rel="image_src" href="/GetImage.ashx?id=55"> Note: This filter will only work on blocks that are on a page. This may not be the case with some workflow actions and email templates. AddMetaTagToHead Show Details Server: v4.0 Creates a meta tag that will be inserted into the HTML head. This is useful for adding social media links. Additional Details Example: "CurrentPerson": { "PhotoUrl": "/GetImage.ashx?id=55" } {{ CurrentPerson.PhotoUrl | AddMetaTagToHead:'property','og:image' }} The tag below will be added to the head of the page. <meta property="og-image" content="/GetImage.ashx?id=55"> Note: This filter will only work on blocks that are on a page. This may not be the case with some workflow actions and email templates. Postback Show Details Server: v3.0 This is a very specialized Lava filter that helps to wire-up ASP.Net postbacks. This is only available on specific blocks that provide 'Postback Commands'. The 'Group Details Lava' is an example of a block that provides these hooks. Additional Details Example: "Group": { "Id": 1 } <a class="btn btn-default btn-sm pull-right" href="#" onclick="{{ Group.Id | Postback:'EditGroup' }}">Edit</a> <a class="btn btn-default btn-sm pull-right" href="#" onclick="javascript:__doPostBack('ctl00_main_ctl33_ctl01_ctl06_upnlContent','EditGroup^1'); return false;">Edit</a> SetPageTitle Show Details Server: v4.0 Takes a string as input and sets the page's title. Additional Details Example: "CurrentPerson": { "FullName": "Ted Decker", ... } {% capture pageTitle %}Current Person - {{ CurrentPerson.FullName }}{% endcapture %} {{ pageTitle | SetPageTitle }} The page title would be: 'Current User - Ted Decker'. Note: The example show will change the page title on the page and in browser window. As of v9.0, if you'd like to update just one you can add an additional parameter to your filter. {{ 'New Title' | SetPageTitle:'BrowserTitle' }} {{ 'New Title' | SetPageTitle:'PageTitle' }} PropertyToKeyValue Show Details Server: v4.0 Takes a property and returns it as a key/value pair. This is helpful for iterating over a list of properties. Additional Details Example: "CurrentPerson": { "Attributes": [ { "FavoriteMovie": "Star Wars" }, { "FavoriteStarWarsEpisode": "Episode VI" }, { "FavoriteStarWarsCharacter": "Boba Fett" } ] } <ul> {% for attribute in Attributes %} {% assign attributeParts = attribute | PropertyToKeyValue %} <li>{{ attributeParts.Key | Humanize | Capitalize }}: {{ attributeParts.Value }} </li> {% endfor %} </ul> <ul> <li>Favorite Movie: Star Wars</li> <li>Favorite Star Wars Episode: Episode VI</li> <li>Favorite Star Wars Character: Boba Fett</li> </ul> Page Show Details Server: v4.0 Returns information about the current page. Additional Details Example: None Title: {{ 'Global' | Page:'Title' }} <br /> BrowserTitle: {{ 'Global' | Page:'BrowserTitle' }} (v9) <br /> Description: {{ 'Global' | Page:'Description' }} (v7 +)<br /> URL: {{ 'Global' | Page:'Url' }} <br /> Page Id: {{ 'Global' | Page:'Id' }} <br /> Host: {{ 'Global' | Page:'Host' }} <br /> Path: {{ 'Global' | Page:'Path' }} <br /> Site Name: {{ 'Global' | Page:'SiteName' }} <br /> Site Id: {{ 'Global' | Page:'SiteId' }} <br /> Theme: {{ 'Global' | Page:'Theme' }} <br /> Layout: {{ 'Global' | Page:'Layout' }} <br /> Scheme: {{ 'Global' | Page:'Scheme' }} <br /> Cookies: {{ 'Global' | Page:'Cookies' }} (v8.4)<br /> {% assign queryParms = 'Global' | Page:'QueryString' %} Query Parms <br /> {% for item in queryParms %} {% assign kvItem = item | PropertyToKeyValue %} {{ kvItem.Key }}: {{ kvItem.Value }} <br /> {% endfor %} Title: Home BrowserTitle: Home of the Browser's Title Description: This is the page description URL: http://localhost:6229/page/1 Page Id: 1 Host: localhost Path: /page/1 Site Name: External Website Site Id: 3 Theme: Stark Layout: Homepage Scheme: http Query Parms Id: 12 SomeOtherId: 23 Note: In most cases the properties are returned as strings. The 'QueryString' property will return an array of query parameters. The Lava sample below shows how to use them. {% assign queryParms = 'Global' | Page:'QueryString' %} {% for item in queryParms %} {% assign kvItem = item | PropertyToKeyValue %} {{ kvItem.Key }}: {{ kvItem.Value }} {% endfor %} The Cookies property will return an array of Cookie objects. {% assign cookies = 'Global' | Page:'Cookies' %} {% for cookie in cookies %} {{ cookie.Name }}: {{ cookie.Value }} {% endfor %} PageRedirect Show Details Server: v4.0 Will redirect the page to the provided URL. Additional Details Be very careful on how you configure this filter. You always want to provide a way to get back to this page, without it redirecting, so that you can edit your lava. Below are two strategies for doing this. If your lava is inside of an HTML block you can use that block's 'CurrentPersonCanEdit' merge field to stop the redirect if the current user has edit access to the block. An example of this usage is below. {% if CurrentPersonCanEdit %} <p class="alert alert-warning">If you could not edit you would be redirected to: <a href="http://www.rockrms.com">http://www.rockrms.com</a>.</p> {% else %} {{ 'http://www.rockrms.com' | PageRedirect }} {% endif %} Another strategy to allow the editing of the lava content is to add ?Redirect=false to the query string. If the lava filter sees this in the page's address it will not perform the redirect. Instead it will display the link that it would have redirected to. Example: "Event": { "ExternalUrl": "http://www.rockrms.com", } {{ Event.ExternalUrl | PageRedirect }} The current page request will be redirected to the address provided. Property Show Details Server: v5.0 Returns the property of a provided object. This often saves you from having to assign an object to a variable to get just one of its properties. Additional Details Example: "CurrentPerson": { "FullName": "Ted Decker", "AnniversaryDate": '', } {{ CurrenPerson.NickName}}, your campus is: {{ CurrentPerson | Campus | Property:'Name' }} Ted, your campus is: Main Campus Note: The 'Property' filter does allow you to use dot notation so you can do things like: {% assign campusLeader = CurrentPerson | Campus | Property:'LeaderPersonAlias.Person' %} {{ campusLeader.FullName }} HasRightsTo Show Details Server: v6.0 This filter helps you check the security of the model you pass it. Additional Details Example: [person model] {{ person | HasRightsTo:'View' }} true Note: In the typical use case you'll be passing full models to the filter. It can also take just the Id of the model as long as you also provide the entity type. The example below would check for edit rights for the group with the id of 12. {{ 12 | HasRightsTo:'Edit','Rock.Model.Group' }} Notes Show Details Server: v7.0 Retrieves notes for the provided entity. Additional Details This filter has plenty of options to help make retrieving notes simple. First you can pass the filter either a full entity (any type) or an integer that represents the entity id. You must pass in either an integer that represents a note type id or a comma delimited string of note type ids. Optional parameters include: Sort Order: string ('asc' or 'desc'). If no option is provided 'desc' is assumed. Count: an integer of how many items you'd like returned. Security is checked on the notes based on the currently logged in user. Example: "CurrentPerson": { ... } {% assign notes = CurrentPerson | Notes:'4,5','asc',2 %} Notes {% for note in notes %} <p>{{ note.Text }} </p> {% endfor %} Notes <p>Note one.</p> <p>Note two.</p> PageParameter Show Details Server: v7.0 Returns the value of a specified page parameter. Additional Details Example: Example URL: http://rock.rocksolidchurchdemo.com/Group/12 The Group Id passed in from the URL is: {{ 'Global' | PageParameter:'GroupId' }} The Group Id passed in from the URL is: 12 Note: If the value is an integer it will be returned as an integer otherwise it will be a string. FromCache Show Details Server: v7.0 Reads objects from the Rock cache which will reduce the number of database reads your Lava produces. Additional Details This filter works by passing in either an integer or Guid of the cached item you'd like along with the cache object type. Supported types are: DefinedValue DefinedType Campus Category GroupType Page Block BlockType EventCalendar Attribute NoteType ContentChannel Example: "CurrentPerson": { "CampusId": "2" } {% assign campus = CurrentPerson.CampusId | FromCache:'Campus' %} Your Campus Is: {{ campus.Name }} Your Campus Is: West-side Campus ResolveRockUrl Show Details Server: v7.0 This filter helps to resolve the application path in Rock using ~/ for the application home and ~~/ for the theme home. This is helpful when writing Lava that may be used by several organizations. Additional Details Example: "Person": { "Id": 12623 } {% assign personProfilePage = '~/Person/' %} The link for this person is: '{{ personProfilePage | ResolveRockUrl }}{{ CurrentPerson.Id }}' The link for this person is: '/Rock/Person/12623' ( assumes Rock was stored in a virtual directory called 'Rock') AsBoolean Show Details Server: v7.0 Converts the input to a Boolean (true/false) value. Additional Details Example: "Workflow": { "Option": "f" } {% assign isEnabled = Workflow | Attribute:'Option' | AsBoolean %} {% if isEnabled == true %} It is enabled. {% else %} Nope, it's disabled. {% endif %} Nope, it's disabled. AsInteger Show Details Server: v7.0 Converts the input to an integer value. Additional Details Example: "Workflow": { "Quantity": "3" } {% assign quantity = Workflow | Attribute:'Quantity' | AsInteger %} {% if quantity > 0 %} There are more than none. {% else %} There are none. {% endif %} There are more than none. AsDecimal Show Details Server: v7.0 Converts the input to a decimal value. Additional Details Example: "Workflow": { "Miles": "5.0001" } {% assign miles = Workflow | Attribute:'Miles' | AsDecimal %} {% if miles > 5.0 %} {{ miles }} is more than 5. {% else %} Less than 5 miles. {% endif %} 5.0001 is more than 5. AsDouble Show Details Server: v7.0 Converts the input to a double value (which has less precision than a decimal). Additional Details Example: "Workflow": { "Precision": "5.00000000000000009" } {% assign miles = Workflow | Atrribute:'Precision'| AsDouble %} {% if miles > 5.0 %} {{ miles }} is more than 5. {% else %} Well, it looks like {{ miles }} ({{ miles | ToJSON }}) is less than 5 miles. Well, it looks like 5 (5.0) is less than 5 miles. Note: Use AsDecimal if you need the highest amount of precision. AsString Show Details Server: v7.0 Converts the input to an string value. Additional Details Example: {{ CurrentPerson | AsString }} Alisha Marble AsDateTime Show Details Server: v7.0 Converts the input to a DateTime value. Additional Details Example: {{ '1/1/2017' | AsDateTime | DateAdd: 3,'d' }} 1/4/2017 12:00:00 AM Debug Show Details Server: v7.0 The debug filter provides you with a ton of information on the variables you have access to in your Lava. Additional Details Example: "CurrentPerson": { "FullName": "Ted Decker" } {{ 'Lava' | Debug }} Note: There are a couple of options on how you use this filter. The default show in the example above will output the debug information for all the variables provided in the merge fields. The information will be shown to ALL logged in users. If you'd like to limit who can see the debug information you can provide a username to limit on. In the example below only Ted Decker would be able to see the debug information. {{ 'Lava' | Debug:'tdecker' }} Up till this point we've gotten all of the variables back from the merge fields. You can optionally just report on a single field by piping it to the filter instead of the global 'Lava' keyword like so: {{ CurrentPerson | Debug:'tdecker' }} Client Show Details Server: v7.0 Returns information about the client browser. Additional Details Example: IP Address: {{ 'Global' | Client:'ip' }} <br /> Login: {{ 'Global' | Client:'login' }} <br /> Browser: {{ 'Global' | Client:'browser' }} <br /> IP Address: 12.34.55.15 (note this is not guaranteed to be the user's IP address, it could be the users firewall / proxy server) Login: tdecker Browser: Windows 10 Other Chrome 57.0.2987 Note: The 'browser' parameter actually returns a structured object with lots of additional information. Below is a JSON representation of the details. { "String": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/57.0.2987.133 Safari/537.36", "OS": { "Family": "Windows 10", "Major": null, "Minor": null, "Patch": null, "PatchMinor": null }, "Device": { "IsSpider": false, "Brand": "", "Family": "Other", "Model": "" }, "UserAgent": { "Family": "Chrome", "Major": "57", "Minor": "0", "Patch": "2987" }, "UA": { "Family": "Chrome", "Major": "57", "Minor": "0", "Patch": "2987" } } ASP.Net also provides several additional server variables. The number and nature of these can change based on server and client. You can pass in any server variable key and the filter will return the value. To get a full list of keys use: {{ 'Global' | Client:'parmlist' }} AddCssLink Show Details Server: v7.0 Adds a CSS link to the page. If the link has already been previously registered (by a block or other Lava) it will not be duplicated. Additional Details Example: {{ 'https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css' | AddCssLink }} <link type="text/css" rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css"> Note: Couple of usage notes: You can use ~/ to have Rock append the application path or ~~/ to append your theme root to your relative links. You can pass in an option paramenter to add fingerprinting to your file. This only works on local links and serves to cache the file on the user's browser. {{ '/Styles/myfile.css' | AddCssLink:true }} AddScriptLink Show Details Server: v7.0 Adds a script link to the page. If the link has already been previously registered (by a block or other Lava) it will not be duplicated. Additional Details Example: {{ 'https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js' | AddScriptLink }} <script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js" type="text/javascript"></script> Note: Couple of usage notes: You can use ~/ to have Rock append the application path or ~~/ to append your theme root to your relative links. You can pass in an option paramenter to add fingerprinting to your file. This only works on local links and serves to cache the file on the user's browser. {{ '/Styles/myfile.css' | AddCssLink:true }} Url Show Details Server: v7.0 The Url filter allows you to easily get access to parts of a URL without a ton of string manipulation. Additional Details Example: {% assign url = 'https://www.rockrms.com/WorkflowEntry/35?PersonId=2' %} Testing URL {{ url }} host - {{ url | Url:'host' }} port - {{ url | Url:'port' }} segments - {{ url | Url:'segments' | ToJSON }} scheme - {{ url | Url:'scheme' }} protocol - {{ url | Url:'protocol' }} localpath - {{ url | Url:'localpath' }} pathandquery - {{ url | Url:'pathandquery' }} queryparameter no key - {{ url | Url:'queryparameter' }} queryparameter with key - {{ url | Url:'queryparameter','PersonId' }} url - {{ url | Url:'url' }} invalid_part - {{ url | Url:'invalid_part' }} Testing URL https://www.rockrms.com/WorkflowEntry/35?PersonId=2 host - www.rockrms.com port - 443 segments - [ "/", "WorkflowEntry/", "35" ] scheme - https protocol - https localpath - /WorkflowEntry/35 pathandquery - /WorkflowEntry/35?PersonId=2 queryparameter no key - queryparameter with key - 2 url - https://www.rockrms.com/WorkflowEntry/35?PersonId=2 invalid_part - Base64Encode Show Details Server: v7.0 Converts a binary file to a base-64 encoded string. Additional Details This filter has an optional input parameter: Image Resize Parameters: If the binary file is an image, this optional parameter can be used to resize and/or format the image using a collection of key/values. See notes below for details. Example: "CurrentPerson": { "FullName": "Ted Decker", "AnniversaryDate": '', } Base64Format: {{ CurrentPerson.PhotoId | Base64Encode }}<br/> Base64Format: {{ CurrentPerson.PhotoId | Base64Encode:'h=92&w=92&mode=max&format=jpg' }} Base64Format: /2wBDAQQEBAUFBQoGBgoWDwwPFhYW... Base64Format: /9j/4AAQSkZJRgABAQEAY.... Note: If using the optional Image Resize parameter, the filter will use the ImageResizer component to resize and/or format the image. Any of that component's supported parameters can be used (click the link for details). GroupById Show Details Server: v7.0 Provides a full Group object by providing an Id of the group. Additional Details Example: "GroupMember" { "GroupId": 234 ... } {% assign group = GroupMember.GroupId | GroupById %} Group Name: {{ group.Name }}! Group Name: Ushers GroupByGuid Show Details Server: v7.0 Returns a full Group object from the Guid of the group. Additional Details Example: "GroupMember" { "Group": { Guid: "8fedc6ee-8630-41ed-9fc5-c7157fd1eaa4" } ... } {% assign group = GroupMember.Group.Guid | GroupByGuid %} Group Name: {{ group.Name }}! Group Name: Ushers CreateShortLink Show Details Server: v8.0 Creates a URL short link for the provided URL. Additional Details There are several overrides you can pass: {{ 'url' | CreateShortLink:token,siteId,overwrite,randomLength }} Definitions token (string): If you'd like to provide the token to use in the short code you can provide it here. Leave this blank ('') to use a random code. siteId (int): The id of the site to use for the shorting. By default the first site found with the 'Enabled for Shortening' set to true will be used. Pass in 0 if you'd like to force the default site. overwrite (bool): This determines what to do if the token you provided already exists. By default it will not overwrite an existing shortcode. If you provided a token, it exists and overwrite is set to false, a new random token will be returned. When set to true then the existing token will be used. randomLength (int): If using a random code, this determines how long it should be. Example: "ConnectionOpportunity": { "Url": "http://www.rocksolidchurchdemo.com/greeters" } Your personalized link is: {{ ConnectionOpportunity | Attribute:'Url' | CreateShortLink }} Your personalized link is: http://www.rocksolidchurchdemo.com/HSGFTSF Note: This filter attemtps to return a valid shortlink at all cost. This means that if the configuration passed to it is invalid it will try to correct it with reasonable defaults. For instance if you pass in an invalid siteId, the first active site will be used. If you pass in an empty URL, or if no shortened site is enabled in Rock you will get an empty string. Md5 Show Details Server: v10.0 Converts a string into an MD5 hash. Additional Details An example use case for this filter is showing the Gravatar image associated with the poster of a comment: Example: "Person": { "Email": "hi@example.com" } <img src="https://www.gravatar.com/avatar/{{ Person.Email | Trim | Downcase | Md5 }}" /> <img src="https://www.gravatar.com/avatar/767fc9c115a1b989744c755db47feb60"> Sha1 Show Details Server: v10.0 Converts a string into a SHA-1 hash. Additional Details Example: {% assign my_secret_string = 'RockIsAwesome!' | Sha1 %} My encoded string is: {{ my_secret_string }} My encoded string is: 845b0f246f221697761d085847fbc056652d03d0 Sha256 Show Details Server: v10.0 Converts a string into a SHA-256 hash. Additional Details Example: {% assign my_secret_string = 'RockIsAwesome!' | Sha256 %} My encoded string is: {{ my_secret_string }} My encoded string is: 06530e8aabeb6becaabcd0c357134f3cd0a340d87500002b0a14929d92e0ac78 HmacSha1 Show Details Server: v10.0 Converts a string into a SHA-1 hash using a hash message authentication code (HMAC). Additional Details Pass the secret key for the message as a parameter to the filter. Example: {% assign my_secret_string = 'RockIsAwesome!' | HmacSha1:'secret_key' %} My encoded string is: {{ my_secret_string }} My encoded string is: 17dbf467d8f49e9f541c7af8adf26c8422bdb342 HmacSha256 Show Details Server: v10.0 Converts a string into a SHA-256 hash using a hash message authentication code (HMAC). Additional Details Pass the secret key for the message as a parameter to the filter. Example: {% assign my_secret_string = 'RockIsAwesome!' | HmacSha256:'secret_key' %} My encoded string is: {{ my_secret_string }} My encoded string is: 3518d7aa4ad81041e14033f2bbfa317e8f2f5aa26d6f48f719783aeaebe481ae XamlWrap Show Details Server: v10.0 Mobile: v1.0 Wraps XAML in CDATA tags to make it XML compliant. Additional Details Example: "Item": { "Id": 12, "Content": '# Heading The quick brown folx jumped over the lazy dog. ', } <Rock:Markdown>{{ Item.Content | XamlWrap }}</Rock:Markdown> <Rock:Markdown><![CDATA[The quick brown folx jumped over the lazy dog.]]</Rock:Markdown> PersistedDataset Show Details Server: v10.0 Returns data contained in a Persisted Dataset as a Lava object. Additional Details Details on how to create a Persisted Dataset are available in the Designing & Building Websites Using Rock guide. Example: {%- assign data = 'mydataset' | PersistedDataset -%} <ul> {%- for item in data -%} <li>{{ item.Title }}</li> {%- endfor -%} </ul> <ul> <li>Friday 3/25</li> <li>Saturday 3/26</li> <li>Sunday 3/27</li> </ul> AppendFollowing Show Details Server: v10.0 Returns the following status for the currently logged in user to the results of an entity command or Persisted Dataset. Additional Details The append following filter is exclusively used by entity commands and adds the property IsFollowing to the returned data object. Details on how to create a Persisted Dataset are available in the Designing & Building Websites Using Rock guide. Example: <p>Entity Command Example</p> {%- person where:'Id != 1' limit:'3' iterator:'People' -%} {%- assign followedItems = People | AppendFollowing -%} <ul> {%- for item in followedItems -%} <li>{{ item.FullName }} - {{ item.IsFollowing }} </li> {%- endfor -%} </ul> {%- endperson -%} <p>Persisted Dataset Example</p> {%- assign data = 'mydataset' | PersistedDataset | AppendFollowing -%} <ul> {%- for item in data -%} <li>{{ item.Title }} - {{ item.IsFollowing }}</li> {%- endfor -%} </ul> <p>Entity Command Example</p> <ul> <li>Ted Decker - true</li> <li>Cindy Decker - false</li> <li>Noah Decker - false</li> </ul> <p>Persisted Dataset Example</p> <ul> <li>Friday 3/25 - true</li> <li>Saturday 3/26 - false</li> <li>Sunday 3/27 - false</li> </ul> FilterFollowed Show Details Server: v10.0 Returns a subset of followed entities for the current user from either a Persisted Dataset or an entity command. Additional Details The filter is used in conjunction with either a Persisted Dataset or an entity command. Details on how to create a Persisted Dataset are available in the Designing & Building Websites Using Rock guide. Example: <p>Entity Command Example</p> {%- person where:'Id != 1' limit:'3' iterator:'People' -%} {%- assign followedItems = People | AppendFollowing | FilterFollowed -%} <ul> {%- for item in followedItems -%} <li>{{ item.FullName }} - {{ item.IsFollowing }} </li> {%- endfor -%} </ul> {%- endperson -%} <p>Persisted Dataset Example</p> {%- assign data = 'mydataset' | PersistedDataset | AppendFollowing | FilterFollowed -%} <ul> {%- for item in data -%} <li>{{ item.Title }} - {{ item.IsFollowing }}</li> {%- endfor -%} </ul> <p>Entity Command Example</p> <ul> <li>Ted Decker - true</li> </ul> <p>Persisted Dataset Example</p> <ul> <li>Friday 3/25 - true</li> </ul> FilterUnfollowed Show Details Server: v10.0 Returns a subset of entities that have not been followed by the current user from either a Persisted Dataset or an entity command. Additional Details The filter is used in conjunction with either a Persisted Dataset or an entity command. Details on how to create a Persisted Dataset are available in the Designing & Building Websites Using Rock guide. Example: <p>Entity Command Example</p> {%- person where:'Id != 1' limit:'3' iterator:'People' -%} {%- assign followedItems = People | AppendFollowing | FilterUnfollowed -%} <ul> {%- for item in followedItems -%} <li>{{ item.FullName }} - {{ item.IsFollowing }} </li> {%- endfor -%} </ul> {%- endperson -%} <p>Persisted Dataset Example</p> {%- assign data = 'mydataset' | PersistedDataset | AppendFollowing | FilterUnfollowed-%} <ul> {%- for item in data -%} <li>{{ item.Title }} - {{ item.IsFollowing }}</li> {%- endfor -%} </ul> <ul> <li>Cindy Decker - false</li> <li>Noah Decker - false</li> </ul> <p>Persisted Dataset Example</p> <ul> <li>Saturday 3/26 - false</li> <li>Sunday 3/27 - false</li> </ul> ToJSON Show Details Server: v4.0 Returns a JSON representation of the object. This is useful if you are wanting to return the object for use in Javascript. Additional Details Example: "CurrentPerson": { "NickName": "Ted", "LastName": "Decker" } {{ CurrentPerson | ToJSON }} { "NickName": "Ted", "LastName": "Decker" } FromJSON Show Details Server: v5.0 Takes a JSON string and makes a Lava object from it. Additional Details Example: NA {% capture jsonString %} { "Name": "Ted Decker", "ServingTimes": [ { "Date": "Friday 3/25", "Times": [ "5:30 pm", "7:00 pm" ] }, { "Date": "Saturday 3/26", "Times": [ "4:30 pm", "6:00 pm" ] }, { "Date": "Sunday 3/27", "Times": [ "6:30 am sunrise", "9:00 am", "10:30 am", "12:00 pm" ] } ] } {% endcapture %} {% assign jsonObject = jsonString | FromJSON %} {{ jsonObject.Name }} <ul> {% for servingTime in jsonObject.ServingTimes %} <li>{{ servingTime.Date }}</li> {% endfor %} </ul> Ted Decker <ul> <li>Friday 3/25</li> <li>Saturday 3/26</li> <li>Sunday 3/27</li> </ul>