0

Dynamic choice applications

table1 is the data location of the material type/material plan/material number
table2 is the table for selecting materials

how to display "NO" in table2 on VIEW (such as image 2) Thanks

2 replies

null
    • cyan_silver
    • 7 mths ago
    • Reported - view
    Also, I would like to ask how to display images if they exist. thinks
    
    • Fred
    • 7 mths ago
    • Reported - view

    You are encountering a frustrating feature of Ninox. Why doesn't the NO field show up in the view table, when it has data?

    It is because Ninox doesn't know how to show the data in your NO field in the table view. That is because you did a select and when you do a select, Ninox always assumes you will return an array even if you only get 1 result. So while Ninox knows how to show data in a form view, it needs to be told specifically what do when the field is shown in a table view.

    This is what you wrote:

    let AA := text('Choice (Brick)');
    (select '數據表1')[TYPE = AA and project = "Brick"].'serial number'

    If you are positive that you will always only get a single result or you don't care if have more than one result and the first record return is OK, a simple fix is:

    let AA := text('Choice (Brick)');
    first((select '數據表1')[TYPE = AA and project = "Brick"]).'serial number'

    As you can see I just add the first() command around the select and now you can add the NO field to the table view. You can also use the last() command or the concat() command.

    But in this case I think an more appropriate command is the record() command.

    let AA := record('數據表1', number('Choice (Brick)'));
    AA.'serial number'
    

    Since you are using the result of a dynamic choice field, the record() command is the fastest way to get the data you need. Plus since it is a single record, Ninox will show it in the table view with no issue.

Content aside

  • 7 mths agoLast active
  • 2Replies
  • 77Views
  • 2 Following