Dictionaries in UiPath output in outlook mail

Hi, I need to retrieve the keys and values stored in a dictionary variable in a outlook mail. For example, I have this dictionary:
Dictionary = {“748201” = "Invoice Tech Department"´}
{“753921” = "Invoice Marketing Department"´}
{“776201” = "Invoice blabla Department"´}

And i want to put something like this in a single email:

The code 748201 of Invoice Tech Department
The code 753921 of Invoice Marketing Department
(…)

How can I send a single Email with all the information of the dictionary?

As mentioned here:

String.Join("<br>", myDict.Select(Function (x) String.Format("The code {0} of {1}",x.Key, x.Value))

1 Like

And if i don’t wanna use html? Because i’m using the body of the outlook email activitie

this is what we adressed above:

When body is isHtmlBody:

String.Join("<br>", myDict.Select(Function (x) String.Format("The code {0} of {1}",x.Key, x.Value))

When Body is PlainText

String.Join(Environment.NewLine, myDict.Select(Function (x) String.Format("The code {0} of {1}",x.Key, x.Value))

Hi @Carla_Munoz

you can try this way

xaml : - Dictionarie to mail.zip (1.8 KB)

you can see the expected out : -

note while sending to mail in the mail body you can use like this

emailBody.ToString()

image

1 Like

you can try that hope it will help for you

let me know anything else

@Carla_Munoz

@ppr what the “x” means? sorry hahaha

its like a temporary variable:

This woooorks!! thank you so much

1 Like

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.