Forum Academy Marketplace Showcase Pricing Features

Conditionals in Find & Replace's Replace By Input

Hi everyone,

I am hoping someone may have an idea for what I am trying to do.

I have built html emails using Xerocode plug in. I added my own main merge fields in this like ##STUDENT NAME## etc. When a user creates a new or updates an existing student profile bubble will generate an email that goes to relevant staff on my side to inform them. We use about 30 find & replaces to replace the mail merge fields to the data inputted.

So for a new record it works fine. All data entered is emailed.

We can do the same when a student is modified to show the result after modifications by pulling from the input fields with new values. However what we would really like to do is only show the data that has changed to make it clear to my staff what the user has changed or even better we might do an email that shows both before and after only for the fields that have changed. For either case I am not sure how to do this. The easiest way in the Find & Replace “Replace By Input” box would be to use a conditional statement before db update that says “If the input value = the db value then blank it out (replace the mail merge with empty text box) and if the input value <> the db value then use the new value”. We would then easily include the old value to which would show what it changed from.

Because we have 30 Find & Replaces which would mean so many 1000s and 1000s of permutations I cannot go through all combinations. I wonder if there is an easy to do this. Can a text field be built with conditionals? like “If x=y then “” else x” or something like this?

Thank you so much! I have spent a whole Sunday on this!!

Please, share some screens or a link to your webpage. I’m kinda lost what you’re trying to do here.

Sorry I am not very good at explainibg things.

The first screen shot shows the email text with mail merges fields that I will find & replace and the second an example of a find& replace.

This may be messy but works to create an email that tells us the values of a new record. What we would like to do if an existing record is updated is have something like for each maile merge replace “If x=y then “” else x” in the Replace By box where x is the new value and y is the old value so the new value only shows if it has been changed.

Does that make sense?

Sorry again.

There is a plugin for replacing lots of things at once, search for “replace” in the plugin store.

Ok that might be useful generally but do not think a bulk edit feature helps for my specific issue which (if I am stating this correctly) is to have conditionality on the text for individual Replace fields in Find & Replace.

When you type a comparison in bubble, you’re able to add a conditional, like “this thing is this thing: format as text”. There you can specify a text for yes result and another text for no result.

1 Like

So can a conditional statement be typed into the “Replace By” field in “FInd & Replace” to go 2 possible values based on the conditional? If so I am not sure how. Thanks,

So can a conditional statement be typed into the “Replace By” field in “FInd & Replace” to give 2 possible values based on the conditional? If so I am not sure how. Thanks,

Everywhere you can add dynamic data comparing things, you can do this.

Oh Thank you. I think I am getting this now. I am working on it and will report back in a bit if it works for me! Thank you.

Thank you. This is excellent and I was not aware of this functionality. This fixed my issue this time and will be very useful in the future.

Here are screenshots in case it helps anyone so that when there is a change in the new value inputted compared to what is in the database it will add text in bold to the html email that shows “old value > new value” and if that value has not changed show the value in regular formatting so it can easily be seen what has been changed and from what value to what value. If 5 fields have been changed these 5 will all be in bold showing before and after with teh other fields in regular formatting.

Obviously this needs to run in workflow before the database is updated with new values from inout fields.

Thank you again!


:+1: I’m glad I could help.

Could you give an example of this within the find and replace box?
Thanks

Hi raharley0, the user stephen.clegg just provided an exemple like that right above, with two screenshots, one showing the Find and Replace box and other showing the Boolean formatting box.

Thanks, I missed those screenshots.

Hi, I am not an expert but if you have any further questions about that I can try and help., Thanks,