Jump to content

Import Value into Checkbox


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

Recommended Posts

I am attempting to import a spreadsheet that has a field consisting of 1s (representing true) and 0s (representing false) seperated by commas that indicate if the company as a specific feature or not. I would like for the check box to be checked if it is a 1 and unchecked if it is a 0. Is that possibe? Thanks.

Link to comment
Share on other sites

A checkbox cannot hold multiple True/False states. You will need to do one of the following:

a) Break the features into individual fields, where each field is either True or False, or

:P Set-up a value list where each feature has its own label, and check only those values that are True.

Both options are going to take some work, so let us know which way you want to go before we get into specifics.

---

Please clarify if this is a one-time thing, or will you be doing this repeatedly.

Edited by Guest
Link to comment
Share on other sites

I have a value list setup for the checkbox. It consists of 8 values. (Full Hookups, Pull Thrus, Cable TV, WiFi, Propane, Pool, Tent Sites, Cabin Rentals). The ideal thing would be to import the records currently using 1s and 0s (ex. 1,1,0,1,0,0,0,1). When I did a test export to a spreadsheet it gave me the values in the value list (which I expected) separated by a small box. I am guessing some sort of ascii something.

I have almost come to the conclusion that it could be less work just to re-enter the information manually rather than spend the time trying to get it to work. I just don't want to have to enter 400 some records. Thanks.

Link to comment
Share on other sites

Nah, it's a piece of cake.

Assuming you have imported the 1,0... flags into a text field, and defined a value list using custom values in the same order as the flags (from left to right):P

Define a calculation field (result is text) =

Let ( [

vList = ValueListItems ( Get (FileName) ; "YourValueListName" ) ;

flags = Substitute ( ImportedField ; "," ; "" )

] ;

Case ( Middle ( flags ; 1 ; 1 ) ; MiddleValues ( vList ; 1 ; 1 ) ) &

Case ( Middle ( flags ; 2 ; 1 ) ; MiddleValues ( vList ; 2 ; 1 ) ) &

Case ( Middle ( flags ; 3 ; 1 ) ; MiddleValues ( vList ; 3 ; 1 ) ) &

Case ( Middle ( flags ; 4 ; 1 ) ; MiddleValues ( vList ; 4 ; 1 ) ) &

Case ( Middle ( flags ; 5 ; 1 ) ; MiddleValues ( vList ; 5 ; 1 ) ) &

Case ( Middle ( flags ; 6 ; 1 ) ; MiddleValues ( vList ; 6 ; 1 ) ) &

Case ( Middle ( flags ; 7 ; 1 ) ; MiddleValues ( vList ; 7 ; 1 ) ) &

Case ( Middle ( flags ; 8 ; 1 ) ; MiddleValues ( vList ; 8 ; 1 ) )

)

Set the field's storage options to "Do not store...". Place the field on the layout and format it as a checkbox, using your value list.

After you have checked the results, you can change the calculation field to a regular text field, and delete the imported field.

Link to comment
Share on other sites

Just change the definition of flags to:

flags = Filter ( Imported ; "01" )

Hard to see why you didn't make it just "10011011" (no commas, no parenthesses, just plain 0's and 1's) from the beginning. Much easier to work with - in Excel too.

Link to comment
Share on other sites

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