Page 1 of 1

Template variable for multiple info items

Posted: Sat Jan 04, 2020 3:24 pm
by kingszg
Hello,
is it possible to include a list of all info item texts / dates for a certain info code in guest communication.

I understand one can list all info items this way:
[BOOKINGINFOITEMS] - Booking Info Codes - Codes and text
[BOOKINGINFOITEMSBR] - Booking Info Codes - Codes and text with line break
[BOOKINGINFOTEXTS] - Booking Info Codes - Text only
[BOOKINGINFOTEXTSBR] Booking Info Codes - Text only with line break
[BOOKINGINFOCODES] - Booking Info Codes - Codes only
[BOOKINGINFOCODESBR] - Booking Info Codes - Codes and text with line break

or the most recent ones this way:
[BOOKINGINFOCODETEXT:] - the most recent Text value of the specified Booking Info Code
[BOOKINGINFOCODEDATE:]- the most recent date value of the specified Booking Info Code

But how do I list all info items / dates for a given info code, something like:
[BOOKINGINFOCODETEXTS:somecode]

Re: Template variable for multiple info items

Posted: Tue Jan 21, 2020 7:33 am
by andrianwidmann
Hello,

You can use the Smart Template Variable - [IFIN:...]. The syntax is:

[IFIN:Needle:Haystack:Found - Print this|Not Found - Print that]

Where Haystack can be a template variable, and the print commands can contain template variables. So, for your scenario:

[IFIN:NAME_OF_YOUR_INFO_CODE:[BOOKINGINFOCODES]:[BOOKINGINFOITEMS]|No Match]

If booking info codes contain NAME_OF_YOUR_INFO_CODE, print all info items, else print 'No Match'.

For more info have a look at the help doc:

https://wiki.beds24.com/index.php/Templ ... _Variables

Hope this helps.