Aller au contenu principal

Expression inside FS_DATASET (radiobutton value)

Commentaires

6 commentaires

  • Zendesk API User
    Author: felix_reinhold - 4/3/2019 15:13

    Hello Dragan,

    for me using #item.IconColor works. Is the field defined as a String in the scheme?

    If you're not sure which datatype you get just use #item.IconColor.getClass().toString() to see if you get a String or sth. like an OptionValue.

    Then you would have to use .getValue() on it.

    My Expression in my testcase looks like this:

    <LANGINFO lang="*" label="Icon (optional)" expression="#item.Label + "-" + #item.IconColor"/>

    Best regards

    Felix

    0
  • Zendesk API User
    Author: draganr - 4/3/2019 15:19

    Hello Felix,

    I've tried with #item.IconColor , but then I get only IDs, so it's broken:

    With #item.IconColor.getClass().toString() i get the same result.

    And, also, the same with .getValue().

    This is my schema:

    Kind regards,
    Dragan

    0
  • Zendesk API User
    Author: felix_reinhold - 4/3/2019 16:27

    Hello Dragan,

    you've set your IconColor as XML, not as String. That's why #item.IconColor is not working.

    Is it a new field? If yes, you should set it to String. If not there's an expression that should work but I highly recommend to migrate the field instead of using the expression:

    #item.getValue("IconColor").getData().getElementsByTagName("VALUE").item(0).getTextContent()

    This snippet gets the Value-Node from the XML representation.

    Best regards

    Felix

    0
  • Zendesk API User
    Author: draganr - 4/4/2019 8:43

    Hi Felix,

    Thank's for the advice, and your help.
    I'm aware of using the string as a better choice, but we needed a radiobutton there.

    Best regards,
    Dragan

    0
  • Zendesk API User
    Author: felix_reinhold - 4/4/2019 9:18

    Hi Dragan,

    You can use the radio button with the field type String - that's what I meant :smileyhappy:

    Best regards

    Felix

    0
  • Zendesk API User
    Author: draganr - 4/4/2019 13:40

    Hi Felix,

    Ah, I tried that once, and I got an error, so I thought it was not possible.

    Thank you so much for your help.

    Best regards,
    Dragan

    0

Vous devez vous connecter pour laisser un commentaire.