Best practice regarding of Design RecordType

Hello:

I am trying to create a RecordType synchronized with a web-service.  One of the data objects obtained doesn't always have the same number of sub-data points (see nutrients in the image).  In order for me to store the nutrients values, right now, I am creating 20 columns (assuming a max) and using a forEach to store each value.  Is there a better way to do this?

Thank you.

  

  Discussion posts and replies are publicly visible

Parents
  • 0
    Certified Lead Developer

    My opinion, based on feedback, nutrient should be its own Record.  Go ahead with synched records, I think they're still very useful for this case.

    The question you need to answer is whether the nutrients have a 1 to Many or a Many to Many relationship with these food items.  Does one food item contain many nutrients, or are there many nutrients that can be associated to many food items?  I'm leaning toward the former, because the amount of each nutrient is unique to each food item, isn't it?  You could also solve for that by making a link table and including the amount alongside the linkage. Still, you know more about your exact use case than I do, so you make the ultimate decision.  It all depends on how the webservice is structured what you're able to do.

Reply
  • 0
    Certified Lead Developer

    My opinion, based on feedback, nutrient should be its own Record.  Go ahead with synched records, I think they're still very useful for this case.

    The question you need to answer is whether the nutrients have a 1 to Many or a Many to Many relationship with these food items.  Does one food item contain many nutrients, or are there many nutrients that can be associated to many food items?  I'm leaning toward the former, because the amount of each nutrient is unique to each food item, isn't it?  You could also solve for that by making a link table and including the amount alongside the linkage. Still, you know more about your exact use case than I do, so you make the ultimate decision.  It all depends on how the webservice is structured what you're able to do.

Children
No Data