Template variable for multiple info items

Topics related to bookings and guest managment
Post Reply
kingszg
Posts: 21
Joined: Sat Sep 21, 2019 7:38 am

Template variable for multiple info items

Post by kingszg » Sat Jan 04, 2020 3:24 pm

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]

andrianwidmann
Posts: 1
Joined: Fri Feb 23, 2018 4:19 pm

Re: Template variable for multiple info items

Post by andrianwidmann » Tue Jan 21, 2020 7:33 am

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.

Post Reply