Appian Lesson: QYD_L6_E1

Hi Everyone,

I am new to Appian and development in general, so, thank you for taking the time to help!

In the Query Your Data Lesson 6_E1, we are asked to create a aggregate query in order to display vehicles by make.  I am able to display the results, however, the results in the drop down menu show the alias and also the entire results in brackets.  I am trying to have the drop down menu only display the vehicle makes.

Expression Rule:

At the beginning of the lesson in the solutions, it says that I am to use a local variable function and gives this as an example or maybe even as the solution:

However, when I tried to wrap the previous code in the function and then index it through .data, I get an error. 

So, then I just duplicated my previous expression rule and basically used this exact code and still get an error. 

Can someone help me understand indexing everything after the .data and what I am missing?

  Discussion posts and replies are publicly visible

Parents
  • After trying, rethinking, and stepping away, I figured it out.  I needed to add the one to many relationship with the recordtype.ax vehicle.maintenance.cost as seen here:

    I am still trying to understand the indexing after the .data though, so if someone reads this, that would be VERY helpful!!!

  • 0
    Certified Lead Developer
    in reply to joshuab8693

    The .data returns a list of all items based on the various fields and filters provided in your query. 
    1. Just .data would return the entire list of records within the batch size, if your querying all fields without filters.

    2. If you have applied a filter, it will return all the records for which the filter applies.

    3. If you add a .data.[recordtype!recordname.field.fieldname], it will only return all the values for that particular field.

    4. Incase you need values from a related record , you can use .data[recordtype!recordname.relationships.relatedRecordName.fieldname]

    5. Furthermore, you can also add .data.aliasName for groupings to get just the values of an alias returned by aggregations.

    This is a generic answer as without understanding your record structure(all relationships and fields in each record) I can't give examples specific to your case.

    The best way to understand the structure is by printing the data returned OR You can try using a separate expression rule to test this by creating a sample queryRecord  and watch the response change depending on your inputs.

    You can refer to this guide if it helps further- 
    docs.appian.com/.../Query_Recipes.html

Reply
  • 0
    Certified Lead Developer
    in reply to joshuab8693

    The .data returns a list of all items based on the various fields and filters provided in your query. 
    1. Just .data would return the entire list of records within the batch size, if your querying all fields without filters.

    2. If you have applied a filter, it will return all the records for which the filter applies.

    3. If you add a .data.[recordtype!recordname.field.fieldname], it will only return all the values for that particular field.

    4. Incase you need values from a related record , you can use .data[recordtype!recordname.relationships.relatedRecordName.fieldname]

    5. Furthermore, you can also add .data.aliasName for groupings to get just the values of an alias returned by aggregations.

    This is a generic answer as without understanding your record structure(all relationships and fields in each record) I can't give examples specific to your case.

    The best way to understand the structure is by printing the data returned OR You can try using a separate expression rule to test this by creating a sample queryRecord  and watch the response change depending on your inputs.

    You can refer to this guide if it helps further- 
    docs.appian.com/.../Query_Recipes.html

Children
No Data