0

Choice fields in dynamic print layout

Hi everyone,

Is there a way to access a column other than the first one, in a choice or dynamic choice field, in the custom JSON of a dynamic print layout?

Let's say I have a choice field, and in the dynamic print layout I'm only able to retrieve the id number for that choice, instead of the values on the second column of the choice or even another column if using dynamic choice. As a work around I've added two extra formula fields for each field of my table with a script to convert the id to the specific value of the columns that I want. 

But as you can figure, if my table has 100 fields, this starts getting very laborious and very prone to input errors. Not to mention if I ever need to make a change, I have to change the script in every one of those 200 formula fields.

Thaks in advance

2 replies

null
    • Fred
    • 3 mths ago
    • Reported - view

    If you are using a simple choice then you can use the text() command. There is no other data besides the choice number and the text associated with the choice.

    For dynamic choice (not multi) then the record() command comes in handy. You can try:

    {
        otherfield: code,
        choice: record(tablename, number(dynamicchoicefield)).fieldname
    }
    

    Good luck and let us know how it goes.

      • fmedeiros
      • 3 mths ago
      • Reported - view

       Each solution worked perfectly for each case (choice and dynamic choice). And turned out to be extremely simple. Thank you very much! I could even grab the color from another column to paint the cell background on the print layout.

      I should have asked before I started creating hundreds of formula fields 😬

      Hope this also helps someone else.

      Best wishes! 👍

Content aside

  • Status Answered
  • 3 mths agoLast active
  • 2Replies
  • 50Views
  • 2 Following