Skip to content
View in the app

A better way to browse. Learn more.

FMForums.com

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Creating a custom result for several flag fields

Featured Replies

I want to create a field that will display a calculated text result based upon several checkbox fields.

Basically, I have 4 check boxes that can be selected and unselected independent of one another. I want to display a friendly result that will display the name of all check boxes that are checked.

i.e.

field1 = 1

field2 = 0

field3 = 1

field4 = 0

would return "Field1, Field3"

and

field1 = 1

field2 = 1

field3 = 1

field4 = 1

would return "Field1, Field2, Field3, Field4"

What's the best way to do this?

Something like this:


substitute( GetFieldName ( CheckBox::field1 ) ; "::" ; "" )


let(a=field1+field2+field3+field4;

case(a=0;""; a=1 ; case(field1 ; "field1"; field2 ; "field2"; field3; "field3" ; field4 ; "field4");

let(b= if (field1; "field1, ") & if(field2; "field2, ") & if (field3; "field3, ") & if(field4 ; "field4, "); left(b ; length(-2)

)

)

)

It's not clear what he's asking, but that would be an answer, if he means he has four fields where a value of 1 is either checked or unchecked. It's not the shortest way to write, but I think it's the way to write it that would calculate as quickly as possible.

He did:

What's the best way to do this?

Something like this:


substitute( GetFieldName ( CheckBox::field1 ) ; "::" ; "" )

Have you actually tried that before submitting it?

It doesn't work. And it doesn't address the problem across the set of fields in the original request.

Have you actually tried that before submitting it?

Yes i did actually!

Works just fine for me if you have a Table named 'CheckBox' and a field names 'field1' respectively.

Yes i did actually!

Works just fine for me if you have a Table named 'CheckBox' and a field names 'field1' respectively.

Perhaps test again? ;)

Something like this:


substitute( GetFieldName ( CheckBox::field1 ) ; "::" ; "" )

This would produce CheckBoxfield1

Why isn't the checkbox assigned to one field? Of course, because I'm Barbara, I will ask, "perhaps you need a join table?"

Perhaps test again? ;)

This would produce CheckBoxfield1

TO have field1 or field 2 ,etc then this would do making sure fields were named properly such as field1, field2,etc,etc


right( Substitute( GetFieldName ( CheckBox::field1) ; "::" ; "" ) ; valuecount( CheckBox::field1) +6 )

If all the fields are in the same table then you can use something like:


Let ( tablename = LeftWords ( GetFieldName ( f1 ); 1);

		 Substitute (

							 List ( Case ( f1; GetFieldName ( f1 ) );

									  Case ( f2; GetFieldName ( f2 ) );

									  Case ( f3; GetFieldName ( f3 ) );

									  Case ( f4; GetFieldName ( f4 ) )

								    );

						    tablename & "::"; ""

						   )

	   )

Nice one.. John.. Detailed , but nice. one. l love it when i post a mistake . i leave some stuff out of whatever i post, every expert is on my butt and all i am trying to do is help someone as best i know.

... Hilarious... :laugh:

It is not helpful to post untested, non-functioning, misleading responses.

TO have field1 or field 2 ,etc then this would do making sure fields were named properly such as field1, field2,etc,etc


right( Substitute( GetFieldName ( CheckBox::field1) ; "::" ; "" ) ; valuecount( CheckBox::field1) +6 )

This is - basically - complete nonsense.

Depending on the values in field1 1 this could produce any of the following:

field1 (when field1 is completely empty)

xfield1

oxfield1

boxfield1

kboxfield1

etc.

Further, it is not dependent on whether field1 contains a "1" character.

Further, it misleads from a more appropriate technical solution such as the join table proposed by Barbara.

Create an account or sign in to comment

Important Information

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

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.