diff --git a/shuffle-tools/1.2.0/src/app.py b/shuffle-tools/1.2.0/src/app.py index cc713f91..4ec05f00 100644 --- a/shuffle-tools/1.2.0/src/app.py +++ b/shuffle-tools/1.2.0/src/app.py @@ -501,13 +501,11 @@ def replace_value_from_dictionary(self, input_data, mapping, default_value=""): "reason": "Mapping is not valid JSON: %s" % e, } - for key, value in mapping.items(): - try: - input_data = input_data.replace(key, str(value), -1) - except: - self.logger.info(f"Failed mapping output data for key {key}") + # Ensure input_data is treated as a whole key + input_data = str(input_data) # Convert to string to match dictionary key format + result = mapping.get(input_data, default_value) - return input_data + return result # Changed with 1.1.0 to run with different returns def regex_capture_group(self, input_data, regex):