how to specify a variable by text when set value
Question

I understand how to set value into variable of structure. like this:

 contact.name = "test"

but its not different from I want. which I want to do is like this:

 variableName = "name"

 contact[variableName] = "test"


is it impossible in outsystems?

mvp_badge
MVP

Hi Jiro,

This is not possible. OutSystems is strongly typed, and its data structures mostly reflect what a database entity would look like, so named indexes are not a thing that is used. However, in special cases, you could use the HashTable Forge component, that let's you do what you want. Use it sparingly though, this is not a paradigm that the OutSystems Platform natively supports.

Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.