Jump to content
Claris Engage 2025 - March 25-26 Austin Texas ×

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

Recommended Posts

Posted

Right, im sure this isnt that complex (but i can be a tad daft sometimes), i have 5 fields, single checkboxes with a value list set to each with the only option being "yes" within the checkbox (i know you can have one field with 5 options ive just being having trouble with the if statements).

If certain checkboxes are selected i need a calculated result to be entered into another field. I.e. if field one is checked, add in text specific to that field. If field two is set to yes add more text to the previous text entered as a result of checkbox one being set to yes and so on.

So i guess my final question is how would i setup a script to check which of the five checkboxes are checked (lets call the fields a - e) and insert text specific to whether or not those fields are set to "yes". I assume this has something to do with loops but i am yet to understand it.

Help would be great, cheers in advance

genx

Posted

Why dont want have calculation field as:

Text=Case(Field1="Yes","Field1_Checked","")&

Case(Field2="Yes"," Field2_Checked","")&

Case(Field3="Yes"," Field3_Checked","")&

Case(Field4="Yes"," Field4_Checked","")&

Case(Field5="Yes"," Field5_Checked","")

Posted

Other options exists though, if you instead make the valuelist

{1,2,4,8,16} instead and draw the single field in a way that hides these numbers, fiddling with custom linespacing makes sense as well.

This makes this posible:

Choose ( Evaluate ( Substitute ( CheckboxField ; "¶" ; " + " ) ) ; result0 {; result1 ; result2...} )

I would expect it to be slightly faster than Case'ing, and if searches are likely does it make sence to have just one indexed instead of five.

--sd

Posted

Aren't you forgetting this is a checkbox field? A single field, with a list of 5 values, has 32 (2^5) possible states. Are you going to write out all 32 possible results for the Choose() function?

Posted

Aren't you forgetting this is a checkbox field?

No I'm not ...it just occured to me that if you structure this way are you forced to think of all posibilities in a organized manner.

Not that it's needed in this case, but...

--sd

Posted

Yes, hiccups occure ...eventhough I was among the jaw-droppers at devcon, when the topic was PHP ...might this be a flaw in the machinery serving or...:

--sd

Posted

cheers guys,

comment your way ended up workin best. For future reference where do you get the § symbol and what abouts does it mean?

Cheers

Posted

The actual character used is not important. I happen to have a non-standard keyboard with easy access to this character, but you can use any character that is not going to be used in the text. It has no meaning - it merely tags the last ¶, so that you don't end up with a trailing " and ".

This topic is 7020 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.