Skip to main content
marcot0005
April 1, 2022
Solved

looping through a dictionary

  • April 1, 2022
  • 6 replies
  • 0 views

I've got a dictionary of values and I would like to either loop through it for a grid, or convert it to something I can loop through. How might I do that? 

For example, I've got this dictionary:

{A: 3.1, B: 2.2, C: 1.3}

I'd like to have a table that is something like Name for the first column containing A, B, C and Value for the second column with the various numbers in there. I'd like to also record a similar in thing in the database. How can I do that? 

Best answer by mikes0011

In 21.4 we got the new function a!keys, which grabs all keys used within a dictionary and returns them in a text array.

6 replies

mikes0011
mikes0011Answer
Brainy
April 1, 2022

In 21.4 we got the new function a!keys, which grabs all keys used within a dictionary and returns them in a text array.

The Expression Guru
marcot0005
April 1, 2022

Perfect, that's what I needed!

mathieud0001
Brainy
April 1, 2022

There's also the getKeysFromDictionary function from the https://community.appian.com/b/appmarket/posts/cdt-manipulation plugin if you're on a version prior to 21.4.