Converting Checkbox field to Yes/No Dropdown(choice list)

kartheeknalli
Kilo Contributor

Hi,

Can anyone please suggest, how can we convert field type of Checkbox to Dropdown(choice list) with choices as Yes No?

I want to change existing field type only as new field creation will cause field name change and will impact scripts where this field is used(Have many fields to make same change)

 

Thanks in advance

1 ACCEPTED SOLUTION

Chuck Tomasi
Tera Patron

As Ashutosh noted, you need to create a new field or you will have data issues. You may not even be able to convert a True/false to a choice list. The system restricts certain types of data type changes.

 

If you want the field name to be the same, then I recommend the following approach.

  1. Create  a new choice field ex: u_choice1 and populate it with Yes/No values
  2. Use a script to copy your true values to Yes, and false values to no from the old field (u_bool) to the new field (raise your hand if you need help with this part
  3. Delete the old field (u_bool)
  4. Create a new u_bool field of type choice
  5. Use another script to copy field values from u_choice1 to u_bool
  6. Delete u_choice1

Now you have a u_bool field of type choice with the true/false values as yes/no values.

 

View solution in original post

7 REPLIES 7

Ashutosh Munot1
Kilo Patron
Kilo Patron

HI,

I will suggest creation of new field. Because if you change the type you can run into some issue's.


You can delete existing checkbox and then create a Yes/No field with same name and then your work will be done.

Before you create field you should delete a field with same name.

 

As a best practice we create new field instead of changing there types after creation.


Thanks,
Ashutosh

Chuck Tomasi
Tera Patron

As Ashutosh noted, you need to create a new field or you will have data issues. You may not even be able to convert a True/false to a choice list. The system restricts certain types of data type changes.

 

If you want the field name to be the same, then I recommend the following approach.

  1. Create  a new choice field ex: u_choice1 and populate it with Yes/No values
  2. Use a script to copy your true values to Yes, and false values to no from the old field (u_bool) to the new field (raise your hand if you need help with this part
  3. Delete the old field (u_bool)
  4. Create a new u_bool field of type choice
  5. Use another script to copy field values from u_choice1 to u_bool
  6. Delete u_choice1

Now you have a u_bool field of type choice with the true/false values as yes/no values.

 

Thank you so much for quick help Chuck.. 🙂

If you've got multiple Yes/No choice lists, I recommend you 'connect' their choices so you only have to maintain them once and not repeated everywhere. See the quick tip on Episode 48 of TechNow.

 

TechNow Episode List