Handle Empty E-mail address in Microsoft 365 People Create/Update Contact

I have data from an external source coming for 3 e-mail addresses. These email address are in order e-mail 1, 2, 3, as they would appear on Outlook/MS365 People contacts.

A user could fill in email-1 and e-mail 2 but not email-3 or any combination of that. When the email field is missing, Make throws a BundleValidationError: Validation failed for 1 parameter(s). * Missing value of required parameter ‘address’.

The issue I am trying to solve is the array enters e-mails into the outlook contact’s email 1, 2, 3 fields in order. So if I a missing e-mail 1 and 3, then I will not be able to update only email 2 without getting this error, and so on.

I have tried mapping the values as an array (using aggregate array) but this throws me the same error. I have tried using the null and emptystring special characters but this also throws me the same error.

I have also tried the solution of checking if the field exists and then creating an n, n-1, n-2, n-3 router paths for each scenario but it will fill in the emails in the order received in the array so this does not work as intended.

Can anyone help me achieve my desired result? Any suggestion is appreciated!

1 Like

Hello SoIU_Admin,

The “Missing value of required parameter ‘address’” error is likely due to the first Email address field being required. E.G. if you have an address for fields 2 and 3, but not one, you’ll likely receive the error.

I’ve set up some IML functions that should always populate the first field if possible. Here’s the input data:
image
Here are the IML functions:


Here’s the results:
image

You should be able to use that same logic for the 3 email fields.

Hope that helps!

3 Likes

Welcome to the Make community!

Perhaps you can use the special keyword {{ignore}} instead of {{null}}?

86b4cc5fb7f219b717cdeb1c8085ebfc4381ef0e

Do this for all three email address fields.

2 Likes

Thanks for the idea! I tried all of the keywords and Make only wants it to be a formatted as an address.

This raises the very important question of how can I even delete an email address from Outlook Contacts when updating them?

I will give this a go! However, I do not believe it will fix my issue of ordering of the e-mail. It will create an issue in ordering the e-mails.

The first e-mail field populated will appear as e-mail 1 in outlook even if the first e-mail field filled out in my data source is e-mail 2. This will lead to the two being out of sync.

I appreciate any other ideas and will let you know how this goes! At this point, I am trying everything.

Aha I know what should be done now.

Every result (item/record) from a search/match/iterator module will output a bundle. To “combine” them into a single structure, you’ll need to use an aggregator of some sort.

Aggregators are modules that accumulate multiple bundles into one single bundle. An example of a commonly-used aggregator module is the Array aggregator module. The next popular aggregator is the Text Aggregator which is very flexible and has applies to many use-cases.

Read this

The Array Aggregator module allows you to build a complex array of collections for a later module’s field to map multiple items (collections) to it.

Here is an example of using the “Target structure type” of an Array Aggregator module:

As you can see, the “Map” toggle on fields are used when you have an array. You can easily build an array variable to map to a field, by using an Array Aggregator module and select the “Target Structure Type” as the future field you want to map the array into.

Then this

You can insert a filter just before the aggregator module, to only accept email addresses that have been entered.

In summary

  • Try to convert the email addresses and names into a single array that can be iterated over.

  • Then add a filter.

  • Aggregate to an array.

  • Map the array variable into the “Email Addresses” field (toggle on the Map button)

3 Likes

I appreciate your efforts on this! It seems reasonable, and I will give this a go.

Do you think this will also solve the issue of deleting an e-mail address when the incoming bundle has the e-mail address as an empty string? Getting late in my time-zone so apologies if this already seem obvious!

Added screenshots

Screenshot_2024-02-22_110258

Screenshot_2024-02-22_110223

Demo: Three goes in, two comes out in a mappable array

I think so, since the filter will stop invalid email addresses, and this will override the email addresses array in the existing contact.

3 Likes

Simple and straightforward way to produce an array. Thank you samliew!

Before I even get to the filter step, I am encountering this error.

Above is my variable set up. The field is missing from the return in Monday Get Item module when the value is missing. This results in an Any type make field for the ‘email2’ field.

Oh your emails are in a single string?

Then just use the the built-in function split directly in the iterator

e.g.:

split(string_variable; ",")

You don’t need an add in this case, which is to combine multiple variables together.

3 Likes

Not in a string! Updated for more clarity!

It is in a collection, and then the collection becomes an any type when the field is missing in the frontend on the ‘data board’ in Monday.

The function parameter separators are semi-colons, not commas!

3 Likes

Apologies for that oversight! I am now seeing the same error I have begun with. Even if I used the regular expressions to filter out bad strings, I am unsure why I keep hitting this error.

:sweat_smile:

Screenshot_2024-02-22_120232

^.+@.+\.\w+$

3 Likes

Thank you for walking me through that! I very much appreciated your support. :star:

Your constructions of arrays and then showing me how to also use filters is informative. I am still trying to figure out how the types play into this. Is the filter of ‘DNE’ sending a different type to the aggregator? Would this not just also be an empty type?

Also the unintended side-effect of not properly ordering the e-mails is still at play, I am unsure if this is just because the make.com People modules forces address value checking. I am not sure MS365 Contacts is storing emails this way. Is make support receptive to feature requests/questions like this?

Screenshot 2024-02-21 231132

Again, thank you for your introduction to the Make community! I look forward to seeing more of your posts. Your past posts already have taught me many basic data structures and their uses!

1 Like

I’m not very sure on the ordering of emails, you might need to contact support for that.

1 Like

I have a similar issue:
I have to handle none or one email address.
When I turn of mapping I always get an error when no email exists - I guess because activating it returns an empty array.

So i want to use mapping and insert an array manually like this:
if(usermail;{{email:“usermail”}};emptystring)

But I’m not sure how the array must look like because there is also a name involved:
image

Here is my attempt to solve this:

Converting my manual string to an array:

Sample result:
image

Here’s how I insert it into the new contact:
image

And here is the error message: