Inconsistencies with boolean fields

Hello,
I’m having some inconsistencies with display of boolean fields, and I’m hoping that someone can help me out.

Please note the following inconsistencies with the following screenshot:

  • Some fields list “Yes” or “No” while others list “true” or “false” (also note the difference in upper/lower-case letters)
  • Some fields are blank


I have tried changing the states of the fields to cycle through them to see if that changes them, but it does not seem to.

Also, what would I need to do to display a bullet or some icon in a space where it’s “Yes” and display NOTHING in spaces where it’s “No” ?

Finally, how would I allow the user to easily sort by these column headers, or filter by multiple selections (like: include Strength & Cardio, or exclude Groundwork, or exclude Chinups)?

You can see the page here:
https://www.seanarenas.com/Workouts/Compare
(You’ll have to scroll down in the table to see the results with things checked in the data collection)

Thank you

Hi,
When you import a csv file to a DB collection, you have the option to set the value of boolean fields. It seems like you imported files few times and changed the value for some of the imports which makes it inconsistence. In order to make sure that all boolean values are displayed the same, I recommend importing again the file (override the content of the collection).

Moreover, currently, there’s no option to insert a certain image instead of the a text value. However, you can check out the Repeaters feature which may an alternative solution for your purpose.

As for filtering the table using multiple user inputs, please check out the explanation given here .

Have a good day,
Tal.

Hello Tal,
I have not done a csv import to this data collection. I’ve only done one ever, and it was to a totally different collection.

This particular data collection was made by Adding Fields, setting them as Boolean, then checking (or unchecking) the box. All done manually, through the spreadsheet interface under Database.

I don’t have a file to import “again” to overwrite the content of the collection, as the collection was not made doing this in the first place.

So, how can I get the fields to operate consistently?

Have you checked the type of the columns in the table? My guess is that some are of type boolean and others are of type string.

HiSam.

Yes, before posting my original post, I checked the type on all of them.

They are all set to Boolean.

I didn’t need to check the type, though; setting a field for boolean puts a checkbox in the space where you would normally enter text. Clicking the checkbox puts a checkbox in it. Clicking it again it removes the check from the checkbox.

All the fields have a checkbox. A box is either checked or not checked. If it’s checked, it should say “Yes” on the displayed table, but it’s saying either “Yes” or “true.” NONE of the fields have a word typed into the space. None of the fields CAN have a word typed into their space, as they are all set to Boolean and are completely unable to accept me typing a word into that space. It’s either unchecked, or checked.

In case you think I’m still not sure how they should be set up, here’s a screenshot.


But before I made the original post stating that there’s an inconsistency with the display, I thought to myself, “Maybe I’m missing something” and went to each of those fields, one by one, and checked the Type, and they are all set to Boolean.

So, what’s the next step in diagnosing this issue?

I figure the best workaround for me is to change all of these fields to “Image” and then upload a bullet for the image, something like 18x18 pixels, and then add it as an image for those that should be marked, and not add to those where it shouldn’t be.

Actually, this may give me even better options … I can upload different symbols for different levels - like, it needs Chin Ups, but how intense are the Chin Ups? Could put 3 different symbols, each a different color… hrmmmm!

Anyhow, would still be nice to address the boolean field display issue, so please let me know any progress on that.

Hi Sam,
Well, I tried what I said I was going to try - changing the field types from Boolean to Image. I then uploaded images to some of the fields. However, on the display, the fields are still acting as if they are boolean - they display Yes or No or true or false, no images.

I checked that I synced the data to live. The images are showing up in the live data, exactly as in my sandbox.
I checked that the fields have been changed from boolean to image. Welllll … they’re letting me upload images, so …

Uhm, I’m going to go ahead and guess that the bug is caused when I created a field as the default type (text) then changed it to boolean, then put a checkmark in the checkbox. My guess is that when a user performs that sequence of actions, they get a different result than if they create a field as boolean from the get go.
e.g.s;

  1. Create a text field
  2. Change the text field to boolean
  3. Make a selection in the field (or not)

-or-

  1. Create a boolean field
  2. Make a selection in the field (or not)

So - there appears to be an issue with switching a field type to boolean. Thoughts?

Hold the phone, I think I figured out another possible place the issue may lie…

When I go to the dynamic page that contains the dataset and the display table, I edit the connection properties. It correctly lists the connection of the field to an Image type field - so it LOOKS like it updated there.

HOWEVER, on the edit screen, it still looks like a boolean type display - it still says “No,” “Yes,” or “[Cardio Data]” - it doesn’t show the picture of a landscape with a mountain and a sun above it, the way it normally does for an image field type…

See this screen shot:


In the database, all of those fields have been changed from Boolean to Image. On the editor for the display page, all of those fields LOOK like they are connecting to an image:

See this screenshot for proof:


However, if you notice on the screenshot for Lower Body and Strength, those have the symbol for an image field type, right?

I got those to work as an Image type by two different methods:
Lower Body - I created a new field (with a similar, but different, name) as type image, then changed the display table’s connection to the new field name.
Strength - I changed the connection on the display table to a different field, then changed it back to the Strength field.

In both cases, those fields now display image data correctly on the site:


So what remains for me to do now is to edit the display table and change the connections to a different field, then back to the correct field, to fix the issue.

What would be nice is that, when we change a field type in the database, instead of just LOOKING like it carried that change over, if it actually carried that change over. The menu for the display table shows that it is connecting to an image field type - so it’s aware that the field type changed. But it did not change the way that it displays the data.

Can this be addressed, please?

Okay, it looks like you’re on your way with a workaround, but I think I wasn’t clear before, so let me explain myself again.

There is a type for each field in the Content Manager where you edit your collection data. There is also a type of each column in the table element that you add to your page.

Right now, it looks to me like you can only set the type via code use the columns property. When connect a table, the types of the columns are set for you. If you later go and change the type of one of your collection fields, the table column type is not updated accordingly. (I think this is probably a bug. I will talk to the people over here about this.)

You can delete the column from your table and then add it again if you want it to get the correct type after you’ve changed it in the collection.

Hi Sam,
Yes, I figured out that I can change the column connection to another field, then change it back to the original field, and it will be set.

I believe that the bug is that when you update the field TYPE in the DB, the MENU that you use to change the field type for the COLUMN on the DISPLAY TABLE is updated, but the ACTUAL DISPLAY is NOT updated. That’s the confusing part. See, I was trying to follow instructions and confirm that the COLUMN is connected correctly - and the menu that you use to connect it SAID that it was connected correctly, it just was not.

So, if that could get addressed, that would be PEACHY.

Thanks!

BTW, here’s how it looks with the images uploaded for each field, and the columns connected to the data correctly.


I’m probably going to shrink the size of the images somewhat, I think they’re slightly overpowering. Do you think they’re simple to understand for most users? Green is easy, Yellow is moderate, Red is Challenging - like the colors on traffic control lights :slight_smile:

Very nice!

I have run into this same problem. My queries against boolean fields were coming back differently than if I applied a filter in the database sandbox. Went a bit nuts trying to figure out why, then I can across this, thanks Sean!

Smelling a similar problem, I exported the database to a CSV file and lo and behold, I have values in Boolean fields with ‘true’, ‘false’ and a blank entry. How can a Boolean field have 3 possible values?

Whatever caused this to happen needs to be fixed ASAP, along with adding sanity checking and correcting on easy data types like Boolean. You can’t tell anything is wrong by looking at the database values in your tool, you have to export it to see the proof.

Hi,

We are aware and working to fix the issue with boolean fields in collections.

Hi, My problem is similar to the initial question although the work around here isn’t going to work for me.
Is it possible for a dynamic page to show a Boolean value as another word?
i.e. the text box on a dynamic page whould show Yes = True and No = False.

If this is not possible, my suggested work around would be to use text fields. However can validation be applied to text fields in the database so that only two possible values can be entered? How would this effect the each functionality / Ability to filter on this value?

Thanks

Joshua

Hi Joshua,
You can use a boolean field type for the collection, add a regular text box and use this code snippet:

$w.onReady(() => {
 let currentItem = $w('#dynamicDataset').getCurrentItem();
 if(currentItem.booleanFieldName){
   $w('#text1').text = "true" 
   }
   else{
       $w('#text1').text = "false"
   }
});

For further questions about this issue, please post a new thread since this is an old one.

Thanks,
Tal.

Hi Ido,
I had a related problem trying to import Boolean values using a csv file. I had a space between the comma and my ‘true’ text.
The import tool told me it was OK (text ‘true’ appeared black, signifying there was no problem, or it would have been red) however the value was not converted properly during the import, and rather than a check I got ‘text’, actually likely got ’ text’ but the web browser didn’t show the space.
Can you have your engineers add a trim() function to boolean values? This can probably be applied to all data types while importing.