Use merged child fields in event template on calendar

  • 1
  • Question
  • Updated 3 years ago
  • (Edited)
Basically, I would like to be able to use a comma separated list of the names of invitees along with the subject on my event calendars.  I've tried adding the EventRelations child object of the Event object, but can't seem to reference anything in it with the Event Template using mustache.  Is there a way to do this? Thanks!

1st post!
Photo of Tom W

Tom W

  • 142 Points 100 badge 2x thumb

Posted 5 years ago

  • 1
Photo of Rob Hatch

Rob Hatch, Official Rep

  • 44,006 Points 20k badge 2x thumb
Welcome to the community Tom.  We are really glad to have you here. 

There is a merge syntax that looks for child relationship records on the model.   Your merge syntax would look somthing like this: 

{{Subject}} <br>
{{#EventRelations.records}}{{Relation.Name}} <br/> {{/EventRelations.records}}


Note that "EventRelations" needs to be the name of your child relationship object added to your model.  The data elements need to be in the model. 

The mustache.js toolset we use follows these conventions: 

# before field means "if this field is found do the following" 
/  before field means "end the if statement" 
^ before field menas "If this field is NOT found,  do the following" 

Let me know if you have any questions about this. 





Photo of Tom W

Tom W

  • 142 Points 100 badge 2x thumb
Works great! I didn't know about the  .records "method" or whatever it is called.  Is there more documentation on stuff like this.
Photo of Rob Hatch

Rob Hatch, Official Rep

  • 44,006 Points 20k badge 2x thumb
Here is an article on all the global merge variables that are available in skuid. http://help.skuidify.com/s/tutorials/m/11720/l/187263-global-merge-variables-functions

What is not included here is the merge syntax associated with model fields.  We need to continue to flesh that out.  Happily, we have hired a new documentation specialist who will be starting in May and will help with some of this sorely needed improvement. 
Photo of Matt Sones

Matt Sones, Champion

  • 31,478 Points 20k badge 2x thumb
Any way to just return the first record of a child object?

I have a model called Case with a child field called Interactions__r. Can I do something like this?

{{{$Model.Case.data.0.Interactions__r.records.0.Id}}}
(Edited)
Photo of Rob Hatch

Rob Hatch, Official Rep

  • 44,006 Points 20k badge 2x thumb
You are on the right track. I don't think you need triple braces.  But other than that I think you shoudl be in business. 
Photo of Matt Sones

Matt Sones, Champion

  • 31,478 Points 20k badge 2x thumb
Thanks, Rob!