Static Entity Iterator in Rowset

Static Entity Iterator in Rowset

  

Hello - I'm new to OutSystems and have gone through most of the tutorials, but I have a situation that I don't quite understand how to handle.  I'm implementing a material data program that receives a JSON file from our ERP.  Basically I'm looping through the received JSON input, which has a material name and a bunch of properties (name and value), and then in each iteration of that loop I'm looping through a static entity of all possible property names.  My question is, how do I retrieve the named property from the JSON input loop using the static name loops value?  Obviously the syntax below is incorrect, but I think it shows the idea of what I'm looking to do.  For example, I'm trying to retrieve JSONDeserializematerialDetail.Data.Records.Current.TareWeight, with "TareWeight" being a defined property name from GetFieldDefinitions.List.Current.materialFieldDefinitions.FieldNames.


SyntaxEditor Code Snippet

JSONDeserializeMaterialDetail.Data.Records.Current. + GetFieldDefinitions.List.Current.materialFieldDefinitions.FieldNames

Hi Tim. This is a problem of dynamically resolving a property on an object. It's not easy to do that in statically-typed languages.

I would recommend you to use the ardoJSON forge component. It is able to dynamically query a JSON string with the JSONSelect action. It can also retrieve the attributes from the JSON with the JSON_GetAttributes action, which might be handy for you.

leonardo.fernandes wrote:

Hi Tim. This is a problem of dynamically resolving a property on an object. It's not easy to do that in statically-typed languages.

I would recommend you to use the ardoJSON forge component. It is able to dynamically query a JSON string with the JSONSelect action. It can also retrieve the attributes from the JSON with the JSON_GetAttributes action, which might be handy for you.

Thanks Leonardo!  I will give this a shot.