Perform conditional action if a value is present in list

Gold Contributor
Gold Contributor

I want to do a conditional action (Show modal) based on a value ( $('[somevalue]').text() ) being present in a list (about 1K of these [somevalue]-values).

Desired behavior: 
Compare value with list
Value in list? if yes: Show modal
Value in list? if no: Do nothing

Is this possible at all and if so, what would be the preffered way of doing it?

3 REPLIES 3

Perform conditional action if a value is present in list

Employee Emeritus

Hi @dajo_rodrigo,

You can add a "Javascript" extension scoped to "DOM Ready" where you can read ($('[somevalue]').text() ) and check the list. 

In order to provide a more complete answer for you, I have a question. Where are these values from the list comming from? Are they dynamic or static values?

Best,

Luciana 

 

 

Perform conditional action if a value is present in list

Gold Contributor
Gold Contributor

@lucianawp, the values are in a static list. (For this particular case: it contains client IDs, I want to show a modal to these clients when they login)


So there must be som esort of lookup I guess. I've looked into the "lookup table"-extension to see if that might work, but I think it is not suitable for my purpose.

Perform conditional action if a value is present in list

Employee Emeritus

Hi @dajo_rodrigo,

you are correct, the lookup table won't be able to be used in this situation in which you need to scrap the webpage, in other words, wait for DOM Ready.

The option will be the javascrip extension  scoped to "DOM Ready" as I mentioned before. In this extenison you will be hardcoding your static list and searching the value $('[somevalue]').text() into this list. 

Implementing the list and the search logic can be done in different ways. I suggest opening a ticket for us and we can have a solutions engineer helping you in this implementation. When opening the ticket please include the list you need to add and the modal code you want to display.

This folllwing link will provide more information about opening a ticket:

https://community.tealiumiq.com/t5/Announcements/Introducing-Tealium-Support-Desk/m-p/16342/highligh...

Let me know if you have any other questions.

Best,

Luciana

 

 

Public