Discussions

 View Only
  • 1.  'ToText' equivalent in Jinja

    Posted 07-27-2022 12:09
    I have a multiple choice field with the options '1,2,3,4'. Since Multiple choice is seen as text, for QB, these aren't actually numbers.

    I have a numerical field, [NumberField].

    In a pipeline I want to set [Multiple Choice] to [NumberField]. I am trying to set a text multiple choice to a number, and QB doesn't like that. My solution for now is just to create a formula text field with my calculation, ToText the result and use that formula field.

    Is there a shortcut to do this all in pipelines? I know below isn't right, but it paints the picture of what I want.

    Set [Multiple Choice] to: ToText{{a.NumberField}}

    ------------------------------
    Mike Tamoush
    ------------------------------


  • 2.  RE: 'ToText' equivalent in Jinja

    Posted 07-27-2022 13:22
    Can you try

    {{a.NumberField|string}}

    ------------------------------
    Prashant Maheshwari
    ------------------------------



  • 3.  RE: 'ToText' equivalent in Jinja

    Posted 07-27-2022 13:32
    Edited by Mike Tamoush 07-27-2022 13:33

    After I posted this, I googled more and found that. I tried it but no luck. Though, Pipelines accepted it (did not highlight the box as an error), so the format it liked. I am wondering if it's just something about setting the multiple choice field.

    To be clear, the pipeline could save and run, but gets an error at that step saying the input is not valid for that Multiple Choice field.

    ------------------------------
    Mike Tamoush
    ------------------------------



  • 4.  RE: 'ToText' equivalent in Jinja

    Posted 07-29-2022 01:42
    In my experience, that tends to mean the multiple choice field isn't set to allow user to create new entries and that there's some difference between what's coming out of the jinja and what you have in the field.  I use the format like what is shown above a lot for your use case {{a.NumberField|string}}

    ------------------------------
    Malcolm McDonald
    ------------------------------