Jump to content
Server Maintenance This Week. ×

extracting data based on field content then executing a script


This topic is 2822 days old. Please don't post here. Open a new topic instead.

Recommended Posts

Hello,

This question likely spans multiple discussion areas (finding/calculations/script) but I thought this would be the place to start (mods, please move if appropriate).

First issue, I'm attempting to extract some data from a text string in a field. The initial field which contains the text strings is a value list; the value list 

contains 3 choices: "x is your vacation time", "y is your vacation time", "indefinite". The user chooses

the appropriate value.  I'd like to have a function/calculation to determine if the value list field choice contains

either "x" ,  "y" or the word "indefinite" . My initial quandary is if getting the desired result is best achieved through an if statement, case statement or another method.

(2nd issue- once the result has been returned, creating a script to copy the result into the other field -I'm imagining a set field- but I can try tackling that once the first problem

is resolved).

Your guidance/thoughts would be appreciated.

Jack

 

 

 

Link to comment
Share on other sites

37 minutes ago, skingjack2 said:

My initial quandary is if getting the desired result is best achieved through an if statement, case statement or another method.

That depends on what exactly you want to do with the desired result. If - for example - you want to use it in order to determine the contents of another field, then you would most likely want to use the Case() function, e.g.=

Let (
w = LeftWords ( Textfield ; 1 )
;
Case (
w = "x" ; "A" ;
w = "y" ; "B" ;
w = "indefinite" ; "C"
)
)

This could be used directly as the formula of a calculation field.

--
P.S. One could argue that the three values -  "x is your vacation time", "y is your vacation time", "indefinite" -  are not members of the same domain, and should not be entered as interchangeable selections into a single field.

Link to comment
Share on other sites

  • 5 weeks later...

This topic is 2822 days old. Please don't post here. Open a new topic instead.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.