Retrieve all Data elements in custom code

Avatar

Avatar
Validate 1
Level 1
wesleybrett1
Level 1

Likes

0 likes

Total Posts

13 posts

Correct reply

0 solutions
Top badges earned
Validate 1
View profile

Avatar
Validate 1
Level 1
wesleybrett1
Level 1

Likes

0 likes

Total Posts

13 posts

Correct reply

0 solutions
Top badges earned
Validate 1
View profile
wesleybrett1
Level 1

22-07-2021

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. 

 

 

Accepted Solutions (1)

Accepted Solutions (1)

Avatar

Avatar
Publish 1
MVP
yuhuisg
MVP

Likes

204 likes

Total Posts

608 posts

Correct reply

125 solutions
Top badges earned
Publish 1
Affirm 100
Springboard
Bedrock
Validate 1
View profile

Avatar
Publish 1
MVP
yuhuisg
MVP

Likes

204 likes

Total Posts

608 posts

Correct reply

125 solutions
Top badges earned
Publish 1
Affirm 100
Springboard
Bedrock
Validate 1
View profile
yuhuisg
MVP

24-07-2021

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

Object.keys(_satellite._container.dataElements)

Answers (0)