How do I get the value of a WFFM field as a tag and output it in a Sitecore DMS report?

佐手、 提交于 2019-12-01 20:52:16

Question 1: How to set the name of the tag

If you set the "Tag" checkbox on the form field, the Item Name (=field name) of the form field is used as tag name. If you have database access, you can check the "VisitorTags" table on the analytics database to see which tags are written and how they are called.

Question 2: Retrieve Tag data in visit reports

In the VisitDetail report, the following inbuilt tags will be displayed if set:

  • Email
  • First Name
  • Second Name
  • Company
  • Organization
  • Full Name
  • StateProvince

Name your form fields accordingly and the values will be used in the report out of the box.

If you want to use custom tags in reports, have a look at the .mrt files in /sitecore/shell/Applications/Reports/. You will have to extend the report to use your own tags.

Example: Adding a custom tag to the VisitDetail report.

  1. Extend the SQL Query to fetch tags in the /sitecore/system/Settings/Analytics/Reports SQL Queries/Visits Visitor Tags item. Add the line

    , MAX(CASE WHEN [TagName] = 'SomeCustomTag' THEN [TagValue] ELSE NULL END) [SomeCustomTag]

  2. Extend the VisitDetail.mrt, add a column with value SomeCustomTag to the VisitorTags section just like the predefined tags.

  3. Use the value of your custom tag inside the report text by using {Visit.VisitorTagsRelation.SomeCustomTag}

I use a text editor to edit the .mrt files, but you can probably also do it in Reports Designer.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!