Copy of multiple choice option after clicking button

  • 0
  • 1
  • Question
  • Updated 1 year ago
  • Answered
I have a button set up in an email notification which changes a multiple choice field to one of the options when clicked. However when doing this, a copy of option that I want is created. On the bar chart report that I made that includes this multiple choice field, I have two columns that show the same option because one was clicked with the button and one was change manually by selecting from the multiple choice field. How do I get rid of the copy and combine them all into one?
Photo of Quinten

Quinten

  • 732 Points 500 badge 2x thumb

Posted 1 year ago

  • 0
  • 1
Photo of QuickBaseCoach App Dev./Training

QuickBaseCoach App Dev./Training, Champion

  • 52,908 Points 50k badge 2x thumb
If similar values are appearing in records, then there must be some difference between the values.  Maybe one has a trailing or leading space, for example.

You need to locate the cause of the bad data entry and then mass update to change the bad data to good data.
Photo of Quinten

Quinten

  • 732 Points 500 badge 2x thumb
The trailing or leading space did not work. I pasted the multiple choice option directly into the button and still got a copy. Not sure what else to do.
Photo of QuickBaseCoach App Dev./Training

QuickBaseCoach App Dev./Training, Champion

  • 52,908 Points 50k badge 2x thumb
May I see the code for your button?
Photo of Quinten

Quinten

  • 732 Points 500 badge 2x thumb
var text URL = URLRoot() & "db/" & Dbid() & "?act=API_EditRecord&rid=" & [Record ID#]

& "&apptoken=b9pzvpjdbfk42zck9xawjk99nx5"

& "&usertoken=b3iezd_xfm_bpqsutvbg5gc46c7aepnhdm8me43"

& "&_fid_282=true"

& "&_fid_279=PLS Review Complete";

"javascript:" &

"$.get('" & 

$URL & 

"',function(){" &

"location.reload(true);" &

"});" 

& "void(0);"

"PLS Review Complete" is what needs to be selected in the multiple choice field.
Photo of QuickBaseCoach App Dev./Training

QuickBaseCoach App Dev./Training, Champion

  • 52,908 Points 50k badge 2x thumb
I suspect that it will work if you do this

& "&_fid_279=" & URLEncode("PLS Review Complete");

The issue is that you are building a URL string.  Whenever you include in a URL any characters, including spaces, which are not one of the A-Z or 0-9, then you must URLEncode.

Think of it this way.

You have never seen a URL in your life which has spaces in it.  They do not exists, at least ones that work properly.  So when you have any special characters including spaces as a possibility in your data, then you must URLEncode.
Photo of Quinten

Quinten

  • 732 Points 500 badge 2x thumb
Yes that did work. Thanks again for the help.