Forum Academy Marketplace Showcase Pricing Features

Conditionally change a datafield

Hello,

I have two data table Golf Course and Golf Scores as illustrated below.

I want to change the values in Golf Score’rating adn Golf Score’slope based on the following use case:
The golfer enters a new score and he played on Golf Course Name “A” on the “White Tees”.
Set the Golf Score’s rating value = to Golf Course’name.course_rating_white.
Set the GolfScore’s slope value = GolfCourse’name.course_slope_white.

If the player entered that he played on the Red tees, then it would be:
Set the Golf Score’s rating value = to Golf Course’name.course_rating_red.
Set the GolfScore’s slope value = GolfCourse’name.course_slope_red.

etc,…

Thank in advance for your help. I’ll keep searching…
Guy

I would look a bit differently at your data structure to solve this.
But there will be lots of ways to crack this.

I would create the following tables to describe your golf courses:

  • Golf course
  • Course rating
  • Course slope

You would also create an option set for each of:

  • Tee colour
  • Slope
    And into them add an option for each colour & slope.

Then your Course Rating table will contain:

  • Golf course
  • Colour (linked to your Colour Option Set)
  • Rating value

And your Course Slope table will contain:

  • Golf course
  • Slope (linked to your Slope Option Set)
  • Slope value

Your Golf Course table would have:

  • Slopes (list)
  • Tees (list)
    These would capture each of the options attributed to the course in the list… this isn’t actually needed as you could always query them the other way round, but personally I would keep them here for ease of reference if you’re not going to be adding slopes or tees often.

You would also switch over the ‘Tee Colour’ and ‘Slope’ fields on the Scorecard to the option sets.


From this structure the queries are very easy and you can use the option set values for both tees and slopes to retrieve the right data and set it to your players’ cards.

It also gives you more flex in the long run if you want to bring other attributes into the experience.

Let me know if you’ve got any questions.

1 Like

Thanks! I’ll study that recommendation.
Much appreciated.
Guy

Hey Edward,
I looked into your suggestion.
The Course rating table is a very good suggestion, using the tee colour option set.
The Course slope values are very arbitrary, so it would be nearly impossible to create the option set for it. So, I think the Course rating (I will call it for now - Course rating_slope) will contain:
Golf Course Name
Colour Tee
Rating Value
Slope Value

Still at it trying to figure out the best approach.
Thanks for the insight!
Guy

1 Like

Sounds good :+1:t3:

Got it! Yé! :grinning:

1 Like