Add new key and value to dictionary variable in assign activity

Hi, there is a way to add new key and value to dictionary variable in assign activity ?
Thanks in advance
Morn

1 Like

hey @111593

d.add(key,value)
d= Your dictionary variable

1 Like

@111593
Use an assign activity:
left side: YourDictVar(YourKey)
right side: Your Value

in case of the key was not present it will be added along with value, otherwise it will overwrite existing value.

As An alternate:
use add to dictionary acitvity
OR an invoke method

The reason why we have to use an invoke method is because of Add. method has no return value (void) and therefore we cannot use within an assign activity

UPDATE: Added Link to a summary of differen Dictionary Actions / Statements
:ambulance: :sos: [FirstAid] Migration to Windows target Framework - Missing Microsoft.Activities.Extensions package - Dictionary Activities - News / Vote on Tutorials - UiPath Community Forum

3 Likes

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