Hi Guys,
In my dropdown list I'm showing two items from my collection with the below code. This works fine.
SortByColumns( AddColumns(Types, "Mod&Des", Concatenate(MType, " - ", Description)), "Mod&Des")
However, when I'm missing either a Mtype or Description its still adding in the "-" as this is a string and will be included for every line of my collection.
Is there a way to add in an if formula when say the Description or Type is empty not to add in the "-", and only add it in when both values are there.
Any help is greatly appreciated.
Thanks
Hi @christian12 ,
Please try:
SortByColumns(AddColumns(FH,"Mod&Des",If(IsBlank(Mtype),Description,IsBlank(Description),Mtype,Concatenate(Mtype,"-",Description))),"Mod&Des")
Best Regards,
Dezhi
No there not choice names
Collection name: Type
Mtype | Description |
22 | |
33 | Blue |
Black | |
44 | Pink |
End Result will look like this. (with also the sort functionality)
Mtype | Description | Mod&Des |
22 | 22 | |
33 | Blue | 33 - Blue |
Black | Black | |
44 | Pink | 44 - Pink |
The code for some reason doesnt work. I get the error column name conflict for 'Mod&Des'
Thanks although I'm getting an if error.
FYI the Mtype & Description are two separate columns in my Types collection.
Unsure if it is the IsBlank part of the code as it is not pointing to a collection/column which might be causing the error.
Thanks again
With({ccat: If(IsBlank(MType),Description,
IsBlank(Description), MType,
Concatenate(MType, " - ", Description)
)},
SortByColumns(AddColumns(Types, "Mod&Des", ccat, "Mod&Des", Ascending)
)