Custom table item Selector syntax

Sylvain C. asked on June 15, 2019 03:25

I have a custom table (EventType) containing a list of event types (meeting, workshop, etc..). This type are in a text field named "TypeName".

I would like to display these types in a dropdownlist in the field of a different page type. The text field in this new page type will be named "Type" and will store the selected event type coming from my custom table.
I start playing with the Custom table item Selector but cannot find the correct syntax to make it work.

What should I put in the "Format of the display name:" and in the "Name of the value column"? I tried several options but none of them succeeded.

Thank you for your help

S.

Recent Answers


Mike Wills answered on June 15, 2019 05:36

Hi Sylvain,

If your ID field is EventTypeID and your display name field is TypeName, here's the configurations you need:

Format of the display name: {%TypeName%}

Name of the value column: EventTypeID

Mike

1 votesVote for this answer Mark as a Correct answer

Peter Mogilnitski answered on June 15, 2019 17:33 (last edited on June 15, 2019 17:37)

Name of the value column - Specifies a column from which the value stored by the selector will be loaded. This must be a unique identifier for the given custom table.

Format of the display name: Determines a format of the item names displayed in the selector. Using macros in format {%ColumnName%} allows dynamically retrieve values of specific items.

So let say your table has ItemID, ItemGUID, EventTypeName, EventTypeDescriptioin etc Name of the value column will be ItemID Format of the display name {%EventTypeName%} or [{%ItemID%}]{%EventTypeName%} (if you want to see the id... sometimes it is usefull)

Just a small tip: If you hold the cursor over the name you normally should geta tooltip: Image Text

1 votesVote for this answer Mark as a Correct answer

Sylvain C. answered on June 17, 2019 04:29

Hi Peter and Mike,
I tried all your suggestions with no success:
My custom table has just 2 fields ItemID (integer) and TypeName (text).
In my meeting page type, I have then added a new field (Field name : eventType), I then choose Custom table item selector for the Form control.
I chose my the correct Custom table. I then entered {%TypeName%} in the format of the display name and then ItemID for the name of the value Column.
When i create a new page based on this page type, the selector is empty (none). If I type [{%TypeName%}] in the Format of the display name, I have 3 [] which appears in the selector.
3 is the number of types available in the custom table so it means there is a connection but what should be the syntax to display the different type names?? It is driving me crazy..
Also, should the field in my page type be the same as the ItemID (integer) in order to make the join?

I am using Kentico 12 MVC with hotfix 26...

0 votesVote for this answer Mark as a Correct answer

Zach Perry answered on June 17, 2019 22:45

Are there any errors in the Event Log when trying to create the new page?

0 votesVote for this answer Mark as a Correct answer

Sylvain C. answered on June 18, 2019 00:27

Hello Zach,
Nothing in the log, everything seems to be fine. I don't see what could cause this issue with the syntax

0 votesVote for this answer Mark as a Correct answer

   Please, sign in to be able to submit a new answer.