Appian Community and Appian Academy are being upgraded. From July 24–August 3, the Appian Community will be in read-only mode. During this time, the site will be read-only and user registration will be disabled. We apologize for any inconvenience this may cause, but a more secure, stable, and performant Community experience is coming soon!

The new Appian Community launches August 3, followed by Appian Academy on August 7. During the migration, Appian Community Edition, Appian Academy, Documentation, Certifications, Instructor-led Customer Training, Partner Sales Training & Accreditation, and Forum (for Appian Partners and Customers only) will remain available.

how to clean a query?

Certified Associate Developer

Hello again, 

you guys were so awesome last time I decided I would take a chance again and reach back out to see if you can help me again,

I am attempting to grab just the actual data from my query,

for example my list of 50 states returns:

on the front end and this is the query returns 

  • Dictionary
      • stateAbrv"AL"(Text)
      • Dictionary
          • stateAbrv"AK"(Text)
          • Dictionary
              • stateAbrv"AZ"(Text)
                • ...

              I have tried to use right( query(), 11

              and I get 

              why are only 2 chars taken off when 11 should be?

              is there another way I could/should be doing this?

              many thanks,

              Kevin

                Discussion posts and replies are publicly visible

              Parents
              • Hi Kevin,

                If the output of your query is a list of dictionary, then all you need to use is an index function.
                Please refer to the following code and try to run it in an expression rule.

                with(
                local!dict:{
                {stateAbrv:"AK"},
                {stateAbrv:"AZ"},
                {stateAbrv:"AR"},
                {stateAbrv:"CA"},
                {stateAbrv:"CZ"},
                {stateAbrv:"CO"},
                {stateAbrv:"CT"},
                {stateAbrv:"DE"},
                {stateAbrv:"DC"},
                {stateAbrv:"FL"}
                },
                fn!index(local!dict,"stateAbrv",null)
                )

              Reply
              • Hi Kevin,

                If the output of your query is a list of dictionary, then all you need to use is an index function.
                Please refer to the following code and try to run it in an expression rule.

                with(
                local!dict:{
                {stateAbrv:"AK"},
                {stateAbrv:"AZ"},
                {stateAbrv:"AR"},
                {stateAbrv:"CA"},
                {stateAbrv:"CZ"},
                {stateAbrv:"CO"},
                {stateAbrv:"CT"},
                {stateAbrv:"DE"},
                {stateAbrv:"DC"},
                {stateAbrv:"FL"}
                },
                fn!index(local!dict,"stateAbrv",null)
                )

              Children