Expandir la barra de logros de la comunidad.

Mark Solution

Esta conversación ha sido bloqueada debido a la inactividad. Cree una nueva publicación.

RESUELTAS

Retrieve all Data elements in custom code

Avatar

Level 2

Is it possible to return a full list of all data elements names in custom code (written under Rules)?

 

I have a few data elements and there will be new elements added in the future. I don't want to update my custom code every time a new element is added. Instead I want to GET a full list of data element names, then loop through the _satellite.getVar("<Data_element_name_here>") function in order to populate my query. 

 

 

Temas

Los temas ayudan a categorizar el contenido de la comunidad e incrementan la posibilidad de encontrar contenido relevante.

1 solución aceptada

Avatar

Respuesta correcta de
Community Advisor

Yes, you can! They're actually available inside the_satellite object.

Object.keys(_satellite._container.dataElements)

Ver la solución en mensaje original publicado

3 Respuestas

Avatar

Respuesta correcta de
Community Advisor

Yes, you can! They're actually available inside the_satellite object.

Object.keys(_satellite._container.dataElements)

Avatar

Level 2
Perfect, thank you! Here's the start of my code encase anyone want to expand on it

Avatar

Level 2
for (let i = 0; i<Object.keys(_satellite._container.dataElements).length;i++) { let dataElementName = Object.keys(_satellite._container.dataElements)[i] console.log(dataElementName) }