concat two fields in choiceLabels of dropdown

Hello everybody,
I am new to Appian and I'm facing this issue.

I am building a simple dropdown interface, getting fields from CDT 'assets', using a local variable dataassets in the load section.
My goal is to show a 'choiceLabels' with concatenation of both fields 'manufacturer' and 'model' but all my attempts were ineffective.
          
The complete code (with my trials) is in attachment.

Could you please give me a suggestion?

Thanks in advance, best regards.
Paolo

OriginalPostID-265502


toforum.txt

  Discussion posts and replies are publicly visible

Parents Reply Children
  • 0
    Certified Lead Developer
    in reply to Mike Schmitt
    You could also use concat() rather than the ampersands... personal preference, though :)

    Oh and... keyword syntax!!
  • 0
    Certified Lead Developer
    in reply to PhilB
    Personally, though concat() was required for the old apply() solution, and can save some clutter when the number of parameters grows, I find the & operator to be a lot less cluttery / more easily readable when there is only a small phrase to stitch together. But as you said, personal preference.

    Also - for me, I'm almost always too lazy to use keyword syntax in the case of system utility rules like apply() or even a!forEach when there is a finite and tightly defined number of parameters (2), which will almost certainly be guaranteed to never grow. Do you find there's anything to gain using it for a!forEach()? I'm open to being convinced, but have never felt the need myself. I do use it basically everywhere else applicable (SAIL components, expression rules, etc), though.
  • 0
    Certified Lead Developer
    in reply to Mike Schmitt

    I've got into the habit of using keyword syntax for any a! namespaced function, but for any fn! namespaced function I don't usually bother as it seems a little overkill for those functions...

    I guess the important thing is consistency - so if , as in that example, the a!dropDown function is written with keyword syntax, I'd continue with keyword syntax for a!forEach.

  • 0
    Certified Lead Developer
    in reply to PhilB
    I can agree with that - and then of course to make things more confusing, several primitive functions break if you try :P (I'm not sure what exact subset of functions does this, but it's true for several i've encountered, which always caused frustration if trying to use apply(), etc).
  • 0
    Certified Lead Developer
    in reply to Mike Schmitt
    Apply definitely doesn't support keyword syntax as you say, but I cant recall another that doesn't - reduce, maybe? Either way I guess we should be using a!forEach now anyway! :)

    it's a bit odd because, for example, one generally uses a!save() in a lot of places but it gets tiresome putting target and value in every time - a!save feels almost like a "primitive" function like apply or concat, but is namespaced as a! so is really categorised in the same group as a!textField... the same can be said of a!forEach or a!flatten, they feel primitive but are categorised as above. Difficult one!

    Actually thinking about it, we should just use keyword syntax everywhere since there's now typeahead for the function parameters!
  • 0
    Certified Lead Developer
    in reply to PhilB

    Oh, I was talking about functions that break outright if you try to pass in keywords.  One example I've run into in the past is substitute().

    I agree with you about maybe just always using keyword syntax for a! functions, except (as you said) how tiring it gets using it everywhere for the "primitive style" ones like a!save (another example where I have almost never bothered using keyword syntax).  But now that autocomplete in the interface editor has improved to the point where it's almost painless to use (as opposed to the torturous pre-17.x version), i might start trying to just go ahead and do it for best practices sake.