Ukraine flag War in Ukraine. Here's what Ablebits is doing to make sure our team and projects are safe.

~%WhatToEnter, WTE

Description

When you paste a template, this macro opens a dialog window and asks you to:

  • enter some text into a text box
  • or select one of the several specified items from a dropdown list
  • or select a date from the calendar
  • or select a row from the specified dataset.

Then the macro inserts the entered text or selected item into the current macro position. The WTE macro can be nested into most of the Shared Email Templates macros, including other WTEs. All the WTE macros of the same nested level are aggregated into one dialog box.

Syntax

~%WhatToEnter{
     "type":"text" | "dropdown" | "calendar" | "dataset",
     "title":"textvalue",
     // in case of text
     "defaultValue":"textvalue",
     "required":"true" | true | "false" | false,
     // in case of dropdown
     "items":[ "textvalue1", "textvalueN" ],
     [ "defaultItem":"1" | 1 ],
     [ "editable":"true" | true | "false" | false,
        [ "required":"true" | true | "false" | false, ]
     ]
     [ "multiselect":"true" | true | "false" | false,
        [ "separator":"textvalue" ] // default separator is comma
     ]
     // in case of calendar
     [ "editable":"true" | true | "false" | true,
        [ "required":"true" | true | "false" | false, ]
     ]
     [ "format":"textvalue", ]
     [ "locale":"textvalue" ]
     // in case of dataset
     "dataset":"textvalue",
     "column":"textvalue"
}

Works for

  • Email templates.
  • Calendar event templates.
  • Mail Merge templates.

Using a text box

  • title—to specify the title of the text box
  • defaultValue—to specify the default value of the text box
  • required—to set up if the user is required to fill out the text box.

Examples of use

~%WhatToEnter{
     "type":"text",
     "title":"Test title",
     "defaultValue":"test default value",
     "required":false
}

Using a dropdown list

  • title—to specify the title of the dropdown list
  • items—to specify the items on the dropdown list
  • defaultItem—to specify the index of the default item
  • editable—to enable the user to edit the text directly in the dropdown box, otherwise the user will only be able to select an item or items from those listed
  • required—to set up if the user is required to fill out the dropdown box
  • multiselect—to enable the user to select several items
  • separator—to specify a separator for dividing items if two or more items are selected.

Examples of use

~%WhatToEnter{
     "type":"dropdown",
     "title":"Test title",
     "items":["item 1","item 2"],
     "defaultItem":1,
     "editable":false,
     "required":false,
     "multiselect":false,
     "separator":";"
}

Using the Calendar control

  • title—to specify the title of the calendar control
  • editable—to enable the user to edit the text directly in the calendar box, otherwise the user will only be able to select a date from the pop-up calendar
  • format—to specify the date format. (It can be omitted if the DateFormat property exists.)
  • locale—to specify the locale for spelled days and months. (It can be omitted if the DateLocale property exists.)

Examples of use

~%WhatToEnter{
     "type":"calendar",
     "title":"Test title",
     "editable":false,
     "required":false,
     "format":"yyyy-mm-dd",
     "locale":"ja-JP"
}

Using a dataset

  • title—to specify the title of the dataset selection
  • dataset—to specify the dataset name
  • column—to specify the column name.

Examples of use

~%WhatToEnter{
     "type":"dataset",
     "title":"Test title",
     "dataset":"Store list",
     "column":"address"
}

Deprecated macros

  • WhatToEnter