Announcement

Collapse
No announcement yet.

using API to create new records does not add user's default team to the record

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • using API to create new records does not add user's default team to the record

    Hi,
    even though I defined the default Team of my API User, when I create a new record of my Entity, the Team is empty if I don't specify it.
    Shouldn't it take the value of the API User's team?
    Thanks.

    Also, I was expecting all the fields that are filled with default or formulas to be populated exactly in the same way as using the web browser, but in fact, there is nothing more than what I submit in my POST request.

    Would it be possible to have an option to simulate this behavior in the future?
    Thanks.

  • #2
    Sorry, in fact, almost everything was due to the fact that the Team was not assigned. Because my Entities had permissions restricted to Team, so if the record has no Team associated to it, then the api user can't edit it afterwards.
    I fixed this in the formula, by assigning the team to the api_user team:
    Code:
    ifThen(array\length(teamsIds)==0, entity\addLinkMultipleId('teams', createdBy.teamsIds));

    Comment

    Working...
    X