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

  • 0
  • 1
  • Question
  • Updated 2 months ago
  • In Progress
  • (Edited)
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? 
Photo of Anshul Goyal

Anshul Goyal

  • 122 Points 100 badge 2x thumb

Posted 2 months ago

  • 0
  • 1
Photo of AustinK

AustinK

  • 1,074 Points 1k badge 2x thumb
I think this should help you out. You will just have to update that field on its own possibly. https://help.quickbase.com/api-guide/field_add_choices.html
Photo of Anshul Goyal

Anshul Goyal

  • 122 Points 100 badge 2x thumb
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
Photo of Anshul Goyal

Anshul Goyal

  • 122 Points 100 badge 2x thumb
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 
Photo of AustinK

AustinK

  • 1,054 Points 1k badge 2x thumb
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.
Photo of Anshul Goyal

Anshul Goyal

  • 122 Points 100 badge 2x thumb
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
Photo of AustinK

AustinK

  • 1,074 Points 1k badge 2x thumb
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

(Edited)