Dynamic Choice as table list/View column
let's say I have a column 'Quantity' in a table/View. I then add/Show a formula column calculated as:-
if Quantity = 1 then "one" else "other" end
In this case, all is correct with 'one' or 'other' displayed in that column, according to the value of Quantity.
However, if I use DC values rather than just text, like:-
if Quantity = 1 then DC1 else DC2 end
the column ALWAYS shows DC1. In fact, it doesn't matter which DC field is where, it always shows the first one.
I should point out that both DCs are essentially the same. So same list of options and same selection. They only differ in the display value. If I simply display either/both of them as their own column, they are correct, but not when part of the if… then logic.
I tried using text(DC) and that works, but if there's no choice it shows 'undefined' instead of being blank, so it's a PIA and requires more script to avoid that.
Anyone come across this? A bug perhaps?
I tried it on my Mac app and was not able to duplicate. I have this code:
if Name = "Glenn" then dChoice else DC1 end
dChoice and DC1 are dynamic choice fields that just happen to point to the same table.
Here is what is looks like in my table:
dChoice field is blank for the record with Glenn so Formula 3 is blank. The record with a empty Name field has the 4th record selected in DC1 so that is what shows up in the table.
For background, both dynamic choice fields are pointing to the same table (Table1). So I went back and selected the same choice for both but had a different text display in each and I encountered your issue.
The else part of the if statement does not pull the text displayed from second dC field.
If I put in text before each dynamic choice then it shows the text displayed in the field.
if Name = "Glenn" then text(dChoice) else text(DC1) end
You are correct that going this route will give you an "undefined" if no selection is made.
So you could do something like the following to take care of that.
if Name = "Glenn" then if dChoice != null then text(dChoice) else null end else if DC1 != null then text(DC1) else null end end