ServerConnect: splitting a post value for API action

Hi everyone,

I’m not experienced with arrays on the server side, I have a use case where I’m posting a number of email addresses separated by a comma (to1@email.com, to2@email.com, to3@email.com):
image

I then need to break down the array, and for eah, generate a json portion of code:

 {
        "emailAddress": {
          "address": "to1@email.com"
        }
      },

So that it fits the requirements of a graph API action:

  "message": {
    "subject": "Multiple recipients test",
    "body": {
      "contentType": "Text",
      "content": "Test."
    },
    "toRecipients": [
      {
        "emailAddress": {
          "address": "to1@email.com"
        }
      },
      {
        "emailAddress": {
          "address": "to2@email.com"
        }
      }
    ],
    "ccRecipients": [
      {
        "emailAddress": {
          "address": "cc1@email.com"
        }
      },
      {
        "emailAddress": {
          "address": "cc2@email.com"
        }
      }
    ]
  },
  "saveToSentItems": "true"
}

I’d appreciate any guidance.

Community Page
Last updated: