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).
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?
02-06-2017 06:33 PM - last edited on 02-09-2017 10:38 AM by TealiumJustin
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?
02-07-2017 12:55 AM - last edited on 02-07-2017 08:22 AM by kathleen_jo
@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.
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:
Let me know if you have any other questions.