I’m trying to build the config variable dynamically and use that variable to get values from config file.
Scenario: currency converter
inner html of these currency is held as key value pair in excel, like as below and held as a config dictionary
|
user gives input for source and final currency as USD or EUR or AUD - keys in the above excel
based on the user input a config variable is created as below
now the question is how can I unpack the value from ConfigDictionary(“”“+SourceCurrency+”“”).ToString that will point to value in excel
In this case we can re use inti All settings xaml from RE frame work. Copy the InitAllSettings.xaml from framework folder and paste into new folder or rename the file.
Input parameters for this initAllsettings.xaml would be
in_ConfigFile - in direction - your Currency excel Path.
in_ConfigSheets - in direction - {“YourSheetName”}
out_Config - out direction - CurrencyConfig
this CurrencyConfig - Dictionary type variable key is string values should be object.
whenver you call config(“USD”).tostring it wpuld give you the excepted value result. thanks.
my bad, I missed to mention I already implemented reading excel and holding that in dictionary.
when I ever call “Config_Source” which holds the ConfigDictionary(“EUR”).ToString as value comes as output but not EUR [Euro] and this is the value held in the excel