Hello,
I want to send an automatic mail, when a ticket enters a certain status. The trigger is working and a mail is being sent. But I am having some issues with getting the email template to work, that I hope someone can help me with.
I want the email to state the name of the people entered in a person/group field. I tried putting in a token according to this article, but even though there is a person entered in the relevant field of my test ticket, the token isn't filled in. When I only reference the field, without an additional property, I get the following text in the email: System.Collections.Generic.List'1[System.Collections.Generic.Dictionary'2[System.String,System.Object]]
Could it be, that the problem lies in the field accepting multiple people? How can I still get the entries into my email?
I want the email to get the values from one columnd of a data table, that is stored in a multi-line-text field.
When I use only the token of the text field, I get the following string from my test ticket: [{"__id":"dbb1ea8a-55a1-4fb0-9349-87a72f5e7bf9","AuftragsNr":"980322233","WirtplanNr2":"12345678","Bemrk":"lorem ipsum","InvestvsUnterhalt":"Invest"}]
But I only want the value under "AuftragsNr". How do I have to configure a token to get that value?
I tried including some values conditionally, but the if-clause doesn't switch to true, when the reference field turns true. Do I need more than the following code to get the if-clause to work?
{{#if Ticket.ReferenceField}}
<p>Some text that I want included</p>
{{/if}}
The person columns contain complex objects so it is not enough just refer to them. Besides, you need to iterate over a collection if it contains multiple values. In my example below, the column is named 'RelatedPersons.'
Sadly, the data table still doesn't yield any output.
The value of the field is entered on a form and saved in the field WirtplanNr, so I used {{Ticket.WirtplanNr.AuftragsNr}} as the token.
Your solution to the person field gave me the idea to try to iterate through the datatable, since it could theoretically have multiple lines. I tried this with
The SharePoint Column Type of field that contains the DataTable is Multiple lines of text, accepts only text and is called WirtplanNr
The content of the field is entered through a form, that I configured with Forms for SharePoint. For that I used a Data Table Control and saved it to the WirtplanNr field, as is decribed here.
The Name of the Data Table is DataTable1.
And it has the following Formatting Properties:
I want to extract the values under AuftragsNr.
As mentioned before, using only {{Ticket.WirtplanNr}} gives me this string: [{"__id":"dbb1ea8a-55a1-4fb0-9349-87a72f5e7bf9","AuftragsNr":"980322233","WirtplanNr2":"12345678","Bemrk":"lorem ipsum","InvestvsUnterhalt":"Invest"}]
Which is also what I see, when I look directly at the field value of the SharePoint Column.
I think that should be everything needed to recreate my configuration. Thank you for your help and let me know if I missed something
I am sorry for the delay, Lea. At the moment it is not possible to refer to the JSON properties stored in a multiline column. Developers will discuss whether it is possible. But what if you store the data from the DataTable1 in a separate list and show them on the ticket form through a list or library control? Then you can add a lookup column in the 'Tickets' list and store there all related items from the separate 'Wirtplan' list. Thus, you will be able to refer to all columns in that list in the e-mail template. Will this workaround suit you?