I am not 100% sure if this is possible. I have a field which auto populates from a choice made in a drop down menu. There are multiple values of "Nullxxx" (Null001, Null002, Null003, etc.), plus other values. I am looking to have this field value change to "N/A" rather than the value of Nullxxx, anytime it sees "Null". If it doesn't see Null, then I want the value to stay as it is imported.
So I would assume something like, If the field value contains "Null", then change to N/A, Else do nothing. I am just not sure if a field value on an auto populated field is possible to change on the fly?
Try putting this in the ready:form event of your field:
Added start of string meta-character to regular expression just in case user puts string "null" in text somewhere.
That didn't do anything. Plus, since the field is empty until populated from the drop-down, wouldn't it need to go into the Change event? And the null values are all Null (the word not the expression) with 3 numbers (Null###). So it needs to test/search for the word "Null" and replace with N/A if it exists. If not I need the value to populate as-is, not be empty/null.
Sorry, I misunderstood. I thought it was data being imported into a field whose values could be Null###.
Will the values in the dropdown be dynamic properties (ie populated at run-time)? Do you want all the values in the dropdown to change from Null### to N/A or just when the user selects Null###?
If it's the latter, put this in the change event:
There are three values in the drop-down that are comma delimited in the binding tab. The text chosen (Null### is never a choice, just a value) will split those values to populate three different fields. The auto populated field in question can have a value of Null###. But there are also values in that field that will not be Null### as a value. So when a value of Null### does populate the field, it would need to change to N/A. If it is a value that is not Null###, it will need to populate as-is.
So there are two things that need to happen:
I hope that is more clear? I am adding a couple of screen shots to help.
Not Null### value
You can use something like this:
Since I don't know what your code looks like to split the values, the code above assumes the variable CircuitValue is what is meant to be put in your Circuit # field.
As you can see from my previous posts though, /^null/i.test(yourstringhere) is the underlying condition that tests whether yourstringhere starts with 'null'.