0

Retrieving values in Dynamic Choice field

New user here - exploring the potential for Ninox to help me with a fairly simple database task. But I’m now getting into it!

In Table-A, I  have successfully populated a DynamicChoice field called “Instructor”  with Names, Colours and Icons from a separate table (table-B). I now want to use the values in a Styled(…) statement in order to use that colour/icon chosen in calendar appointments.

All worked fine when the field was previously a simple choice field - I could successfully use:

Styled(text, color(Instructor), color”black”, icon(Instructor))

BUT, now the same field name is a Dynamic Choice Field and I am unable to write an error-free reference to “Instructor”.

How do I reference color ands icon result from the dynamic choice selected?

Thanks in anticipation from a new SQL/Ninox/code-writing student (aged 71!)

5 replies

null
    • Fred
    • 3 days ago
    • Reported - view

    So it looks like color() doesn't like dynamic fields.

    What you can do is create two new formula fields (recColor and recIcon) in the root table of the dynamic field. Then copy the code from the dynamic field into their appropriate fields, plus making any modifications as necessary. I try not to name fields that have the same name as Ninox commands.

    This will allow you to:

    1) use the record() command to get the record and then reference the color and icon fields.

    2) update the dynamic color and icon formulas to point at the new fields instead of putting in the code.

      • Keeping the grey cells active…..
      • Graham
      • 2 days ago
      • Reported - view

       many thanks. I’ll have a go.

      one last thing…..where do I find a good tutorial on use of fields and accessible values in Ninox? Is there a key name (I.e. where, select, record, etc) reference document?

      • Fred
      • 2 days ago
      • Reported - view

      forgot to welcome you to Ninox. Which platform are you using Ninox on?

      There is a tab in the Forum called Documentation. This is the official Ninox docs. It is very basic.

      I came into Ninox with no background in coding or database, so I had a very large learning curve. You can see how my DB has transformed through the years in this post. I found videos from Ninox and Nioxus on YouTube very helpful. Nioxus also does a weekly Thursday learning lab that is free to attend. But the most helpful thing I found was to get a membership with them which gives you access to their entire learning lab archive. It has many years worth so they have covered all aspects of Ninox and you can watch on your own time.

      You can also post in their forum and we will help you as best we can.

      • Keeping the grey cells active…..
      • Graham
      • 2 days ago
      • Reported - view

       thanks Fred - I’m getting there! I have read loads and viewed tutorials a lot over the last 48 hrs. I am however finding some inconsistencies needing workarounds. Anyhow, database functional….at last. Thanks.

      I'm running the macOS app, iPad app as well with the latest database being primarily calendar based. Printing though….. as a non-subscriber, am I restricted to basic pdf output?

      Last q… I’m using a function field in a table to filter a subset of records. It’s a yes/no field, but it also appears in the table views & print view option. Hiding the field, sadly stops the functionality as well. I need a filter field that doesn’t print!! So I applied the filter directly to the field being filtered…result, yes/no in that field instead of data. Yawn!

      • Fred
      • 2 days ago
      • Reported - view

      Sadly I've never really learned the old print module. It was too limiting so I never learned it. Maybe someone with more experience can help.