n2_space Posted January 3, 2013 Share Posted January 3, 2013 Hello all! I'm trying to update an existing template we have in our store that uses iforms and external data files. I want to create a rule to insert static text (just one sentence) at the end of a paragraph only if the value in the iform is a certain text. There are 12 different values in the value column of the iform that need to trigger this sentence to be inserted. We currently pull info from the external data files, but not sure how to create a rule to insert static text based on the drop down selection in the store corresponding to the value of the data in the iform. Any thoughts? Quote Link to comment Share on other sites More sharing options...
Dan Korn Posted January 3, 2013 Share Posted January 3, 2013 I would just create a Switch Wizard rule to map the field values to the static text. Or you could do it with a "switch" statement in JavaScript, something like this: switch (Field("YourFieldName")) { case "value 1": return "A sentence to add for Value 1"; case "value 2": return "A different sentence for value 2"; // etc. // etc. case "value 12": return "A sentence for value 12"; default: return ""; } Quote Link to comment Share on other sites More sharing options...
n2_space Posted January 4, 2013 Author Share Posted January 4, 2013 (edited) I would just create a Switch Wizard rule to map the field values to the static text. Or you could do it with a "switch" statement in JavaScript, something like this: switch (Field("YourFieldName")) { case "value 1": return "A sentence to add for Value 1"; case "value 2": return "A different sentence for value 2"; // etc. // etc. case "value 12": return "A sentence for value 12"; default: return ""; } thanks! used thw switch rule and got it all working, hurray! Edited January 4, 2013 by n2_space Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.