0

Combine answers from separate dynamic choices in one field.

Hello Everyone.

I have a relationship table that shows ingredients for a recipe. Some items may be from a recipe, some from items, and some from products. All are from separate tables. When I create a kit, I may choose from recipe, items or products (all have a separate space to choose from per line).

On the relationship table, I want it to give me the unit of the selected dynamic option (oz, each, page, for example) I want to have any of them show up depending on which one I choose so I can see it on the relationship table. Right now it's adding them together and giving me 1 because I use one per line. I'm was using the following code.

'Plant Unit' + " " + 'Recipe Unit' + " " + 'Item Unit'

I changed to the following code but it's not correct.

join(chosen(Tasks.'Plant Unit'), ", "(Tasks.'Recipe Unit'))

Can I get a little help on what code to use?

Thank you. Shawna

5 replies

null
    • Shawna
    • 4 days ago
    • Reported - view

    Example. I want one field that says unit instead of 3 separate fields.

      • Fred
      • 4 days ago
      • Reported - view

       So each record will only have either a plant unit or item unit or recipe unit? If that is the case, why not just have 1 field called unit value then a choice field where you select either plant/item/recipe?

      Then you can create a formula field, called Amount, with:

      'unit value' + " " + unitchoice

      and with the data you show it will show:

      4 oz

      Then you can display the Amount field in the view element.

      Or if you don't want to change then in a new formula field, called Amount, your code could look like:

      let displayUnit := switch true do
          case 'Plant Unit':
              'Plant Unit'
          case 'Item Unit':
              'Item Unit'
          case 'Recipe Unit':
              'Recipe Unit'
          end
      Amt + " " + displayUnit

      Again, assuming that a record only has a value in one of the three Unit fields. The switch will check for a value in each of the field and only show the one that has a value.

      • Shawna
      • 4 days ago
      • Reported - view

       I have 3 different databases because each one has completely different information. I think I need to rethink how this is set up before moving on. Thank you for your help! I will save both formulas until I sort it out. 

      • Fred
      • 4 days ago
      • Reported - view

       databases? or tables?

      • Shawna
      • 4 days ago
      • Reported - view

       I meant tables

Content aside

  • 4 days agoLast active
  • 5Replies
  • 21Views
  • 2 Following