Import Microsoft 365 Users into PS HelpDesk contacts list

Hello,

Please advise. Also see attached document with a screenshot and description of errors received below.
Plumsail Power Automate Errors - import MS 365 Users into PS HelpDesk contacts list.docx (97.1 KB)

After following the suggested instructions on this page to import Microsoft 365 Users into the HelpDesk contacts list, the following two errors were received.

If the Apply to each loop’s selected output from the previous steps is configured to include “Body” as shown in the documentation, the following error is received.

Error Details

The execution of template action 'Apply_to_each' failed: the result of the evaluation of 'foreach' expression '@body('Search_for_users_(V2)')' is of type 'Object'. The result must be a valid array.

The feedback from the error above led us to try the expression, “array(triggerOutputs()?['body'])”, instead of Body as the selected output from the previous step.

If the expression, “array(triggerOutputs()?['body'])” is added under the Apply to each loop in place of “Body”, the following error is received.

Error Details

Start time

Apr 6, 11:26 AM (

)

Duration

00:00:02

Error

Action 'Create_a_contact_2' failed

RAW INPUTS

{

"host": {

"connectionReferenceName": "shared_plumsailhelpdesk",

"operationId": "_flowV4ContactsPost"

},

"parameters": {

"contact/email": null,

"contact/title": null,

"updateIfExists": true

}

}

OUTPUTS -

{"statusCode":401,"headers":{"strict-transport-security":"max-age=15552000; includeSubDomains; preload","referrer-policy":"strict-origin-when-cross-origin","CF-Cache-Status":"DYNAMIC","Report-To":"{"endpoints":[{"url":"https:\/\/a.nel.cloudflare.com\/report\/v3?s=a5tSp1zGX5z1XIQMV%2Fvar%2FrCdymbNILSTeqABqFjXc44bgqaR%2BfK8pI7us4QBG0dnfufQEx0EfRcJtI3Ruu1i79Vn5wli19fAo2u5zhsSaRJXpZMchxs0r0J5GjIydzWxUpam%2FUSJCsBhb318cbEnNA%3D"}],"group":"cf-nel","max_age":604800}","NEL":"{"success_fraction":0,"report_to":"cf-nel","max_age":604800}","CF-RAY":"7b3b0cc95aafe236-ORD","alt-svc":"h3=":443"; ma=86400,h3-29=":443"; ma=86400","Timing-Allow-Origin":"*","x-ms-apihub-cached-response":"false","x-ms-apihub-obo":"false","Date":"Thu, 06 Apr 2023 15:26:34 GMT","Content-Length":"34","Content-Type":"application/json"},"body":{"error":"Invalid API key"}}

Hello! It seems that the output was renamed: now it is 'value' instead of 'Body.' Please use the following configuration:

1 Like