Given key is not present in dictionary


Sir why the problem is arrising
I have hidden the mail ids for security reasons

Hi @syedirfan_uddin,

Possible reason 1:
You have an empty space after the word like so EmailReceiverSPACE
Config("EmailReceiver").ToString probably fails beacuse of it.

Dear sir,
There is no space

Hey @syedirfan_uddin

Possibilities:

  1. You have placed Config file in a different location.
  2. Put some value in the excel file for the Key, then try.
  3. If the cells are merged, please make it correct.

While creating dictionary key value pair make sure you have used .ToString.Trim with the key

And is there any other dictionary key used in mail body apart from TO recipient

Use a writeline above to this SEND mail activity and mention the same what is been mentioned in TO input
Let’s see the output panel on what is being fetched

Cheers @syedirfan_uddin

There’s no value in the spreadsheet so maybe it isn’t creating a key for it.

Anyway, is this automation unattended? If so, don’t use config files. Use arguments/parameters.

@syedirfan_uddin

Check if you are passing the Config argument correctly

Also, you can check the value by using the log message

Hope this may help you

Thanks

HI @syedirfan_uddin,

There can be any of the few reasons for this error:

  1. Name of the key is different in config file.
  2. Some spaces are included in the name which has to be trimmed.
  3. Config dictionary object that you are using is not the right one or doesn’t have anything or is not passed correctly to the sequence.

For you, looks like reason 3 to me.

Can you verify if that Config variable you are using is the right one?

Please go to InitAllSettings argument list and verify if you have saved out_config from that workflow into this Config variable or not?

Also, see if this value is getting replaced anywhere before sendoutlook activity?
Also, you can try to print other values from Config using log message and see those are getting printed.

This way you can track if Config contains anything and where it is wrong.

REgards
Sonali

@ syedirfan_uddin
Could you solve it?

such doubts can be cleared by following procedure:

  • set a breakpoint on the failing activity
  • debug and get paused
  • inspect within the different debug panels the config dictionary

I fixed my problem by the way.
The config file path was wrong.

I updated and the process worked.

1 Like

:stuck_out_tongue: @Saltukhan_Dura btw did you find it earlier and posting it later?

haha :slight_smile: I found later.

1 Like