#1
|
|||
|
|||
![]()
I'm given fields with multiple characters where each character is used to "turn on" content within a rule. The order of the characters is random. How do I write a rule to tell FusionPro to look for a certain character within a string, ignore all other characters, and the order of the characters?
Example: Field Name = Optional Field String 1 = AXYD Field String 2 = DYXA If X is in string show content 1. If Y is in string show content 4. I'm already using rules that show content based on an exact string match and am looking for the flexibility to show content based on contains vs. an exact match. Thank you for any assistance you can provide! -Ryan |
#2
|
||||
|
||||
![]()
if (Field("FieldName").indexOf("AAAA") > -1)
This returns the index of "AAAA" within the given string starting with 0. For instance if your string is "zzzAAAAzzz" it would return 3. If your string is "zzzBBBBzzz" it would return -1 because the search string is not found. So, if it returns greater than -1, then you have a match. |
#3
|
|||
|
|||
![]()
Hi Thomas,
Thank you for the response. I'm not sure my question is clear. I need FusionPro to look at a field that will contain multiple characters in random order. Then tell FusisionPro to show content when a field contains a specific character regardless of where it is in the string. Example: If field "PTO" contains "A" display "Lakeland, FL". Strings in PTO could be "124Abd3", "A3429", or just simply "A". Thanks, Ryan |
#4
|
||||
|
||||
![]()
if (Field("PTO").indexOf("A") > -1)
__________________
Brad Mather WestCamp |
![]() |
Thread Tools | Search this Thread |
Display Modes | |
|
|