This binding converter would allow something to be true/false, if the source contains ANY info or not. This would be very helpful for certain things to happen if an Excel cell is blank. Or if the cell contains something.
Here’s a simple example that I run into ALOT:
Often when working with a data set in Excel, there will be some columns that contain information in the row, and some that do not. For example, if I’m going to show a list of something I might have ListHeader, ListItem1, ListItem2, ListItem3. But not all the records may have 3 items in the list. Some may have two, and some might have 1.
I only want bullet points to show up next to items in the list that are NOT blank. So I could bind the visibility of the bullet point to the list item, and set the converter to be “Not Blank” So that means visibility is TRUE when the current excel cell is Not Blank…ie; contains anything.
I know this can be done by adding a column for EVERY list item called Show bullet with True/False. But that gets redundant to have a column for every list item. Also, it doesn’t account for dynamic data…which means you’d need to manually label true/false for each row yourself.
My example is simple, but there are many more uses…and more complex things can be done. For example, setting Toggle buttons to check/uncheck based on data that is or isn’t there - opening up your whole list of actions.
This binding converter would be another step forward to dynamic elements that are conditional to the data being shown.
Hey @AlexL, I actually just tried this and couldn’t get it to work. I went to the Javascript library page that the documentation refers to and tried a bunch of other things (changing the “” to null, undefined, (), etc. But I’m like a blind man navigating a maze here lol.
Could it be that the excel sheet I’m comparing to doesn’t have numerical values, it’s just a bunch of text statements?
Maybe I missed something? Thanks again for any advice.
@AlexL You’re a life saver, thanks so much for your help once again. I FIGURED IT OUT!
It’s actually a small thing that needs to change in your script. True/False need to be “True” and “False”. That must be the way the visibility boolean needs to see the value.
Once I added quotes, my bullet points magically appear and disappear according to blank/non-blank cells! Hooray!
This small piece of information may also be a huge help for a different project too. Very grateful.
P.s. I can also verify this works when you bind visibility to the excel sheet cell, or directly to the text item.
(I edited this statement) At first, I thought this was only working part of the time. But now I see that when you bind the visibility to a text item that is bound to excel…in composer, it may not always be accurate if you edit the excel doc on the fly.
But when running the program, it appears to work as normal. Just a small tip I learned.
Just a quick note for later (year 2023+) editors, I wasn’t able to get the above to work until I changed the “” in the first line to simply null (with no quotes):
Alternatively, below is what I use on a daily basis. I ‘think’ I had troubles with the previous when working with tablets, and this solution seems to work for all: