Skip to content

Commit

Permalink
Added json and yaml as alternative source for lookup block
Browse files Browse the repository at this point in the history
  • Loading branch information
Ariel Abuel (NCS) committed Jan 5, 2022
1 parent d1edde7 commit 90629a7
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions config/data_source_config_common_functions.go
Original file line number Diff line number Diff line change
Expand Up @@ -156,6 +156,7 @@ func getLookupValue(lookup []map[string]interface{}, default_excel string, defau
var lookupValue = ""
for _, lv := range lookup {
if lv["Column"].(string) == key {
// added json and yaml as source lookup
if lv["Json"] != nil {
jd, _ := stringToInterface(lv["Json"].(string))
jsondata := jd.(map[interface{}]interface{})
Expand All @@ -175,9 +176,11 @@ func getLookupValue(lookup []map[string]interface{}, default_excel string, defau
} else if lv["Worksheet"] != nil {
excel_file := default_excel
excel_pass := default_password
// added external excel file as source lookup
if lv["Excel"] != nil {
excel_file = lv["Excel"].(string)
}
// added property for password protected Excel worksheet
if lv["Password"] != nil {
excel_pass = lv["Password"].(string)
}
Expand Down

0 comments on commit 90629a7

Please sign in to comment.