Forum Discussion

AnshulGoyal's avatar
AnshulGoyal
Qrew Trainee
6 years ago

send multiple values (multi select field) for a field through Quickbase API (preferably using URL)

Hello Community Members,

I am trying to use Quickbase API (using Tableau) to be able to edit a record in Quickbase tables. I am able to send the request for single select fields but one of the fields in multi select. I am getting an error when I am trying to pass more than 1 values for that field. I am sure it should be possible for me to send multi-select values for a field. I am sending the API request through URL (by making use of Tableau's URL actions). The sample request I am sending is:
***************
https://<root url>/db/<db code>?a=API_EditRecord&rid=1434&rl=ee2&noPrevNext=true&dfid=10&_fnm_Publishing_Status_Date=<update time>&_fnm_Publishing_Status=<Publishing Status_Multi>&apptoken=<appcode>
**************
The field 'Publishing Status_Multi' is a multi select field and has values as "testresponse1;testresponse2".

The error I am getting is:
**********************************
<qdbapi>
<action>API_EditRecord</action>
<errcode>2</errcode>
<errtext>Invalid input</errtext>
<errdetail>
You must provide a valid choice for the field named "Publishing Status" with field id 114.
</errdetail>


<rid>1434</rid>
<num_fields_changed>0</num_fields_changed>
<update_id/>

</qdbapi>
******************************************

In the Quickbase help guide, I did not find any example where they showed the sample API request for a field with multiple values. Is it even possible? 

6 Replies

  • Hi Austin,

    Thanks so much for your reply. I am able to add new responses using the option you mentioned. However, I am still unable to send multiple values using URL for the field. Please guide me if you have the required information.

    Regards,
    Anshul
  • Hi Austin,

    Please ignore my previous message. I was not constructing the correct URL for API call. I am able to send multiple values to a single field now. Thanks again!!!

    Regard
    Anshul 
    • AustinK's avatar
      AustinK
      Qrew Commander
      How were you able to accomplish this? I'm just curious about the way you did it. I'm sure this question will come up again and you might help someone in the future if you post your solution.
    • AnshulGoyal's avatar
      AnshulGoyal
      Qrew Trainee
      Nothing fancy actually. I am just using Tableau's URL action to build a URL like this:
      https://<rooturl>/db/?<dbname>a=API_EditRecord&rid=1434&rl=ee2&am...time>&_fnm_Publishing_Status_Done_By=<Username>&_fnm_Publishing_Status_Notes="<Publishing Status Notes>"&_fid_114=<Publishing Status_Multi>&_fnm_Publishing_Status_Feedback=<Publishing Status Feedback>&apptoken=<apptoken>

      For multi-select field (_fid_114), earlier I was trying to send multiple values for this field but I was using the actual field name (Publishing Status). On changing the field name to field ID, I was able to update QB table with multiple values. Not sure but QB may be only expecting field-id to update multiple values for any field. Please let me know if you need any more details. Happy to share!!!

      Regards
      Anshul
  • AustinK's avatar
    AustinK
    Qrew Commander
    I'm not sure how Tableau works as I've never used it. It really depends on how Tableau does the multiple choices. The way QuickBase wants them is like "fid=114&choice=Bob
    &choice=Mary". From doing a quick read on url actions with Tableau it looks like you can setup a delimiter character in it for the multiple fields. Their FAQ is not great. 

    The url you want to end up with is something like this and it doesn't seem possible with the FAQ I looked at. I would have to actually mess around with the program and I cannot do that. The problem is QuickBase does not want to accept delimited data in the url that way. It might be possible using XML but I will leave that to someone else.

    https://target_domain/db/target_dbid?a=API_FieldAddChoices&fid=114&choice=Bob
    &choice=Mary&apptoken=app_token


    Doing a little more research it seems like this is not something that will come easy. The top post there from QuickBase Coach says it is not the easiest thing and he knows what he is talking about when it comes to QuickBase. Maybe you are trying to do less with it but I would look into what they are saying.

    https://community.quickbase.com/quickbase/topics/how-to-link-quickbase-with-tableau