Knackpy: update connected field value

Hi all,

I’m using Knackpy to create records on a knack’s db. Everything works (slowly, but it works), except one thing: I’m not able to assign a value to a connected field, remaining always blank.

I have two db, “db.Projects” and “db.Docs” (ID: “object_6”). dbProjects has a field “Project Code” that connects with db.Docs.

Let’s say one of the “Project code” values is “ATM001”, with internal ID “6221efc2f1a20c001e957bc7” .

On db.Docs, the connected field shows as (obtained from a manually entered record):

"field_36":"<span class=\"6221efc2f1a20c001e957bc7\">ATM001</span>", "field_36_raw":[{"id":"6221efc2f1a20c001e957bc7","identifier":"ATM001"}]

So far I’ve tried (none of them working)

  1. data[“field_36”]=“ATM001”
  2. data[“field_36”]=“6221efc2f1a20c001e957bc7”
  3. data[“field_36”]="<span class=“6221efc2f1a20c001e957bc7”>ATM001"
  4. data[“field_36_raw”]=[{“id”:“6221efc2f1a20c001e957bc7”,“identifier”:“ATM001”}]
    (and then creating a new record with:
    app.record(method=“create”, data=data,obj=“object_6”)

Any idea of which is the correct way of doing this, or any turnaround?

Thanks!

try

data[“field_36”]=[“6221efc2f1a20c001e957bc7”];

remove
data[“field_36_raw”]=[{“id”:“6221efc2f1a20c001e957bc7”,“identifier”:“ATM001”}]

Regards,
Sunny Singla

or
data[“field_36”]=;
data[“field_36”].push(“6221efc2f1a20c001e957bc7”);

Hi Sunny, thanks for your help.

Unfortunately, the problem was a bug on my program, that for that particular field used the name field instead of the internal field name (“field_36”). After correcting it, it works with the expected command:
data[“field_36”]=“6221efc2f1a20c001e957bc7”

Thanks again and sorry!

1 Like