Adding Sample Template through senaite.jsonapi to a sample will not add the corresponding analyses services to it

Hello.
If I create a sample through the senaite.jsonapi and add a Sample Template to it, this will not add the Analyses services that are part of that template, to the sample. Is this part of the design or perhaps I am doing something wrong. If its the latter, is there a way to add multiple analyses to a sample upon creation through the API.
I would really appreciate any guidance concerning this.

For anyone else facing the same problem: A way to add analyses services to a sample upon creation is through adding an Analyses tuple in the data dict of the to be created sample. The tuple will contain the UIDs of the desired Analyses services.

data = {
    ...
    "Analyses": ("uid1", "uid2"),
    ...
}

I used a list structure to include analyses uids.
Like,
data = {
…
“Analyses”: [“uid1”, “uid2”],
…
}

It also works.

1 Like