Importing O365 users via Power Automate - Search and import troubles

Hi there,

I followed your knowledge abse article here, but am facing two problems:

  1. Although my API Key in Plumsail is telling me something different, Power Automate says it's not editable

image

  1. How can I search for Users with our company email (domain)? When I search for the name (as part of the domain), I only get users containing the company name in their "surname", it's not actually searching the field "mail".

Any help would be appreciated...still no expert with Power Automate :wink:

Hello! Could you share a screenshot of API key's type in the HelpDesk settings? It should have the 'Edit' one.

As regards the second issue, I would advise to add a condition to the flow and if the current user meets your requirements, perform further steps.

Okay, I got it partly running:

I created a new API which works, but actually both are on "Edit". Also I cannot delete the first one, but so be it.

The condition helped a lot. That was simply something about Power Automate I didn't know, but exactly what I was looking for :slight_smile: It does produce some errors, but all users are contacts now.

Interestingly, deactivated users got added with email address, yet only as "end-users", while for the regular users no email was added for them as "members"

Last, but not least I'm struggling with custom fields (position and department). Those are part of the Office Profile but not default for the contacts. I added the colums and tried to import them via a simple JSON, but they don't seem to work with dynamic variables? Again, no real clue of what I'm actually doing:

image

(It's giving me a "Please insert a valid value for "JSON" error)

Member contacts do not have e-mails stored in the 'Contacts' list. Instead, HelpDesk uses the connected SharePoint user profile to retrieve the required contact data (see column 'SharePoint user'). In the case of the end user contacts, they are treated as external contacts and thus their addresses should be saved in the list. I believe that it is alright if disabled contacts are added as end users, is not it? If not, how would you like to process such contacts?

(It's giving me a "Please insert a valid value for "JSON" error)

The issue is in the syntax:

I believe that it is alright if disabled contacts are added as end users, is not it? If not, how would you like to process such contacts?

Oh, that's fine! I guess I'll just look for a way to filter deactivated contacts at some point, but due to a high level of fluctuation there will be a lot of inactive users at some point anyway, so I don't bother too much with that.

The issue is in the syntax

Works like a charm!

Next step will be some customization of the views, especially the contact details including my custom fields. That's a story for another ticket, tho.

Thanks a bunch!

1 Like

I tried to reproduce everything in the productive environment, but get errors now...What did I do wrong now? :smiley:

Error reads:

"body": {
    "error": "Failed to update ContactRead list item #244: {\"odata.error\":{\"code\":\"-1, Microsoft.SharePoint.Client.InvalidClientQueryException\",\"message\":{\"lang\":\"de-DE\",\"value\":\"Beim Versuch, den Wert einer Navigationseigenschaft zu lesen, wurde ein PrimitiveValue-Knoten mit einem Wert gefunden, der ungleich NULL ist. Es wurde jedoch ein StartArray- oder StartObject-Knoten oder ein PrimitiveValue-Knoten mit einem NULL-Wert erwartet.\"}}}"
}

}

(Translation: ‘When trying to read the value of a navigation property, a PrimitiveValue node with a non-NULL value was found. However, a StartArray or StartObject node or a PrimitiveValue node with a NULL value was expected.’)

Hi! The 'Organization' field is a lookup so to update it, you need to pass an integer: it is an ID of the accordant item in the 'Organizations' list. Also, in this particular case, the name of the property should differ a bit from the column name:

{
  "OrganizationId": 1
}

You can create a custom text column, for example 'Organisation des Kontakts' and fill it with text values.