Each post has 3 stored values: ItemType, PostType and PostReaction. For each post I render on the page, I want to display the correct Post User Text per my matrix.
One way to do it - which feels horrific - is to have a 27 conditions on the field that displays Post User Text. Doing that for each post in a RG feels wrong.
I was rather hoping I could do it with a single concatenated find/replace statement, but find/replace is not available for the display field.
Any suggestions for an efficient/elegant solution?
An alternative could be to add the post user text as a 4th stored value when that post is created.
If you are rendering the text dynamically upon dynamic selections of these values during a user session, avoid as much as possible to interact with the dB. Build logic and calcs that render on the page. And then, try to save it to the dB so that for the next session the post user text renders as a default value from the dB, and gets changed as inputs are changed on the page.
I thought about db performance too so I’m glad you mentioned it.
I managed to get it down to 3 conditionals using find/replace, but I’m hoping I can replicate that logic upon save, per your suggestion, and save the text as a new data field for simpler rendering.