jstanden / cerb

Cerb is a fully customizable, web-based platform for enterprise communication and process automation. Create high volume shared inboxes. Integrate with any API-based service and automate nearly any repetitive digital workflow using the specialized KATA language and browser-based coding tools. Production: https://github.com/cerb/cerb-release/
https://cerb.ai/
Other
80 stars 38 forks source link

fix issue where json encoded array was encoding twice #1725

Closed nicholsk18 closed 1 year ago

nicholsk18 commented 1 year ago

based on documentation https://cerb.ai/docs/records/types/group/#records-api members are supposed to be JSON-encoded array. this fix removed the line that was encoding the already encoded array.

jstanden commented 1 year ago

For reference, the way you'd normally use this from something like an automation is:

start:
  record.create:
    inputs:
      record_type: group
      fields:
        name: Example Group
        members:
          manager: 1
          member: 2,3,4

So all this patch does is allow something like this from the API:

start:
  record.create:
    inputs:
      record_type: group
      fields:
        name: Junk
        members@text: {"manager": "1", "member": "2,3,4"}

The code that processes the members field still expects a comma-separated list of IDs, since the field originated in the API before automations/KATA allowed richer data types.

nicholsk18 commented 1 year ago

Okay, thanks for the explanation. I was having an issue adding people to groups via API, but I forgot about the automation stuff. Thanks for the correct fix!