Skip to main content
Question

Create relationship between records via an api request

  • Jan 7, 2019 4:42 PM UTC
  • 2 replies
  • 77 views

Hi there,

We are using the PHP SDK for interacting with the QuickBase api and have successfully managed to add new records using API_AddRecord.

The problem we have is there doesn't seem to be a documented way of creating relationships via the api.

For example, we would like to create a new entry record and store the questions/answers they've submitted in a separate table, linked to the entry by Record ID so that all data can be pulled through and filtered from the entries table in the QuickBase dashboard.

Entries table

RID: 34
Name: John Smith
Age: 45
Nationality: British

Answers Table

RID: 101
Question: Do you undertake moderate exercise 2-3 times a week?
Answer: Yes
EntryID: 34

RID: 102
Question: Do you smoke?
Answer: Yes
EntryID: 34

Has anyone managed to carry this out via the api before? Any help or pointers would be appreciated.

Thanks in advance,

Nick

This topic has been closed for replies.

2 replies

You seem to be confusing creating a new relationship with simply connecting the child child to the parent by populat8ng the field Typically named something like

[Related Parent] or in your case probably called [Related Entry]

I don�t do that scripting work myself, but I assume when you use the API to create the Entry it will respond with a success response and provide you with the [Record ID#] of thentry. Then you use that value to populate the [Related Entry] field in all of the child Answers records,

  • Qrew Cadet
  • Mar 30, 2020 6:00 PM UTC

I'm having the same problem using node.js. I can create the parent record entry fine, and I can create the child records fine too, but I can't create the relationship. I have two relationship fields - formID and parentRecordID. In the API call I have:

<field name="parent_recordid">121</field>

<field name="form_formid">430091</field>

and the parent_recordID gets filled with 430091 (the form ID) and the form_formID field is left blank, and there's no error reported with the QB API.

Any idea of why this is happening? Or were you able to figure this out?

- Rod



------------------------------
Rod Montrose
------------------------------