Forum Discussion
- QuickBaseCoachDQrew CaptainTry this. I will use formula variables to break the formula into smaller pieces.
var text Temp = Left([my text field],"x");
Length($Temp) +1- Jan-WillemSpeckQrew Assistant CaptainI would like to go one step further with this function.
1) find a specific chararter combination
ie
var text Temp = Left([my text field],"#%");
Length($Temp) +1
2) from the position where "#%" is located I like to read the next 5 characters
ie Mid([field], <start position>, 5)
if I replace <start position> with the two lines in 1) it doesn't work. I assume it has the do with the variable, the code in 1) or with the ;
Is there a better way to get this?
In an even better scenarion I should perhaps first check if the text string contains the value "#%" at all to avoid wrong output of 1). Currently if it can't find it seems to result in the sting length - QuickBaseCoachDQrew Captaindid you try this
var text Temp = Left([my text field],"#%");
var number StartPosition = Length($Temp) +1;
Mid([field], $StartPosition, 5) - Jan-WillemSpeckQrew Assistant CaptainNo I didn't.
But what I learn from this is how to define and use variables and that you can treat the formula field also as a field where we can enter pieces of code because that is what you actually doing.
And that opens new possibities, lots of them
What a joy :-)
for the second time today
TXS!!
- QuickBaseCoachDQrew CaptainNote that if your goal is to parse out a section of text up to a character, that the Left and Right functions in Quickbase will do that for you. You can do this
Left([My string],6)
But as you can see above, you can also do Left([My String],"x") which gives all the text up to the first x.- AdamKrzyzanekQrew CaptainI know it is old Post but Was looking for this solution and did not find in Community.
Come up with such solutions posted HERE
------------------------------
Adam Krzyzanek
------------------------------