parseJSON auf einen String (aus einem Datastore)

Hallo,


ich hatte das Problem schon mit (nicht-)MAPs, aber ich bekomm die Lösung nicht auf JSON übertragen:


Ich ziehe mir das Feld "VariationPropertyIDsJSON" als String aus einem Datastore. Dann möchte ich (im selben Mapper) auf einen Wert zugreifen, also mach ich:

${parseJSON(result['VariationPropertyIDsJSON']).at("3")}

Bekomme aber zurück:

Script error: You have used a variable (parseJSON(result["VariationPropertyIDsJSON"]).at) which does not exist. This can happen if you misspelled the variable, forgot to check if if the variable exists or paused a previous step. (Root Causes: InvalidReferenceException: The following has evaluated to null or missing: ==> parseJSON(result['VariationPropertyIDsJSON']).at [in template "old_ListingID" at line 1, column 3] ---- FTL stack trace ("~" means nesting-related): - Failed at: ${parseJSON(result["VariationProperty... [in template "old_ListingID" at line 1, column 1] ----): ${parseJSON(result['VariationPropertyIDsJSON']).at("3")}

Wenn ich stattdessen aber


${parseJSON(result['VariationPropertyIDsJSON'])}


ins Feld einfüge kommt aber kein Fehler, sondern eben das JSON. Die Variable ist also nicht falsch.


Was mach ich dann falsch?


Danke Daniel

Ohne parseJSON bekomme ich erwartungsgemäß

Script error: The type of a value differs from what was expected. (Root Causes: NonHashException: For "." left-hand operand: Expected a hash, but this has evaluated to a string

zurück...

Ahhh, so gehts:



${parseJSON(result['VariationPropertyIDsJSON'])['3']!}