You are viewing limited content. For full access, please sign in.

Question

Question

If field A is value 1, I need field B to be value 2

asked on June 12, 2024

...more specifically, if a field using a lookup rule is E, I need EXEMPT, and if the lookup rule returns N, I need NON EXEMPT, etc.  I've tried two separate fields with IF and SUBSTITUTE calculations, but just haven't gotten it to work.  Is the only way to do this by writing in JS/jQuery?  If not, what might be easier?  Any help or guidance would be greatly appreciated.

Thanks

0 0

Answer

SELECTED ANSWER
replied on June 12, 2024

If one field is holding the value then this should work:

=IF(YourField="E","EXEMPT", 

IF(YourField="N","NON EXEMPT",""))

 

0 0
replied on June 13, 2024

Thanks, Ms. @████████!  I appreciate you taking the time to respond.

If for some actions, we still want to allow the submitter to change the selection once we pull it in, is there anyway to have this "calculation" in a dropdown field?  Or, would I have to have it in a single line and somehow use JS to customize that single line to look like a dropdown?

Thanks again!

0 0
replied on June 13, 2024

You could add a drop down field that allows them to select a different option either using a lookup from SQL or hard coded in the drop down field.  Then add another single field and use the calc tool to determine which one to use.

=IF(YourDropDownField<>"",YourDropDownField,YourField)  

The 2nd single field would be your final result.  I would suggest asking the question of if they need to override the original result and then showing the drop down field.

 

1 0
replied on June 13, 2024

Thank you!

0 0
replied on June 13, 2024

If I'm bringing in other data from a lookup rule, like a middle name, but only need the middle initial, is there a way to do this without JS?

I tried the LEFT calc and reg ex, but to no avail.  Wondering if that has to be done before the data is brought in, or JS for that specific field to only allow the first character.

0 0
replied on June 13, 2024

It is cleaner to format a view in SQL.  Use LEFT(MiddleName,1) AS MiddleName.

0 0
replied on June 13, 2024

I figured it was cleaner to do in SQL.  I'm already directly connected to a view for our financial/HR software, so didn't want to have to produce my own view.  A lot of joins, lol. 

I was able to accomplish by setting the character limit to 1 for now.

Again, really appreciate all your help!

0 0

Replies

You are not allowed to reply in this post.
You are not allowed to follow up in this post.

Sign in to reply to this post.