"Add to dictionary" Activity is not available in uipath studio

Hi,

I am doing the automation on sending SMTP mail. In this i have stored the receiver mailID, subject and body of the mail in the excel sheet as shown below. Since, the new update in studio does have “Add to dictionary” activity i’m not sure how to read the excel data as dictionary. I have to read column “Titles” as key of the dictionary and column “Details” as value of the dictionary using “for each” activity.

image


Thanks in advance, kindly help me to resolve this.
Yazh

Hey

can you try with Add to Colletion activity instead?
image

Regards!

Hi,

Is “Master” Dictionary? If it’s type is Dictionary(Of String,String) the following will work.

First, define the following before the loop

Master = New Dictionary(Of String,String)

Then, put the following expression in the ForEachRow loop

Master(row("Titles").ToString) = row("Details").ToString

OR, use just the following expression. This create dictionary from datatable directly.

Master = DT.AsEnumerable.ToDictionary(Function(r) r("Title").ToString, Function(r) r("Details").ToString)

Regards,

get a presentation on dictionary activities without the need of referencing a package:

:ambulance: :sos: [FirstAid] Migration to Windows target Framework - Missing Microsoft.Activities.Extensions package - Dictionary Activities - News / Vote on Tutorials - UiPath Community Forum

1 Like

this is not an error. Using toString is not exposing the dictionary content / key collection content

Alternate:
Understanding the 6 Debugging Panels of UiPath in the easiest way possible! - News / Tutorials - UiPath Community Forum

1 Like

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