How to display data Dropdown from rule using database

Hi everyone i am new at Appian and i m trying  to understand how i display the labels and the choice values that comes from a DB . into a dropdown and save it in a rule input after

its throwing an error that i dont understand.

can someone explain what is my error and what is the better solution for doing this ? 

thank your

  Discussion posts and replies are publicly visible

Parents
  • This is a tricky issue to troubleshoot - I believe what's happening is that there is a type mismatch between your choiceValues and your saved value. The choiceValues are of type dictionary (because that is what is returned by a!queryEntity()), but the value is of type Sector_Activity. For a dropdown field to work, the types and values must exactly match.

    It actually looks to met that you're pretty close with yoru commented out code - if you run the cast you already have there against your query result, it should cast correctly and it should eliminate the type mismatch.

Reply
  • This is a tricky issue to troubleshoot - I believe what's happening is that there is a type mismatch between your choiceValues and your saved value. The choiceValues are of type dictionary (because that is what is returned by a!queryEntity()), but the value is of type Sector_Activity. For a dropdown field to work, the types and values must exactly match.

    It actually looks to met that you're pretty close with yoru commented out code - if you run the cast you already have there against your query result, it should cast correctly and it should eliminate the type mismatch.

Children