Hi all,
I have a Sharepoint list that has a lookup column from a Months Table. In the log form that I created that has the Month drop down from the lookup column, the column is not showing the months in the correct order. I have researched on here and found a couple sort drop down month column entries, but those did not fit my scenario. I have tried several different variations within the "Items" value of the drop down to no avail. The list that is tied to the form is brand new and does not have data in it yet. Any help would be appreciated. So far I have tried:
Sort(Choices([@'SP List'].Month), Text("SP List.Month", "[$-en-US]mmm"), Ascending)
and it does not sort or do anything.
Solved! Go to Solution.
Biggest issue there I assume would be that months are not in alphabetical order, and since its technically just a collection of strings you wouldn't have much to sort them by.
You could do it like this
Sort(
ForAll(
//////MonthTest is a collection of month names I made for this test
MonthTest,
/////MonthName is the name of the column in that collection, this & MonthTest are
////the parts you would need to switch to match YOUR list of months
{
/////First we collect the month name
Month:MonthName,
///Next we set its order value
Order: Switch(
MonthName,
"January", 1,
"February", 2,
"March", 3,
"April", 4)}),
///Last step is to tell this dropdown to sort by the order column we set
Order, Ascending)
Gives us a dropdown of months, sorted in their calendar order
Biggest issue there I assume would be that months are not in alphabetical order, and since its technically just a collection of strings you wouldn't have much to sort them by.
You could do it like this
Sort(
ForAll(
//////MonthTest is a collection of month names I made for this test
MonthTest,
/////MonthName is the name of the column in that collection, this & MonthTest are
////the parts you would need to switch to match YOUR list of months
{
/////First we collect the month name
Month:MonthName,
///Next we set its order value
Order: Switch(
MonthName,
"January", 1,
"February", 2,
"March", 3,
"April", 4)}),
///Last step is to tell this dropdown to sort by the order column we set
Order, Ascending)
Gives us a dropdown of months, sorted in their calendar order
Should I be inserting "Choices('SP List'.Month)" where you have MonthTest? Also, after I input the "{", it wants me to use a ThisItem....
Just for clarification, this drop down is from a Sharepoint List and that Sharepoint list has a Month column that is a lookup from a table called "Months". That table is laid out with two columns, the Month Name and the Month Number.
Yah, whatever your source will be goes in replacement of MonthTest. If checking an entire list of items, just the list name, then reference the rest in the {} section below. If a specific record something more liek the choices(record.column) will suffice. after the { you will start with Month: followed by a formula to set month name so should be something like Value(? I think, depends on what chocie column tables are laid out like, I THINK they use Value:"Choice" format so something like Month:Value,Order:Switch based on value of month namme
User | Count |
---|---|
254 | |
106 | |
92 | |
47 | |
37 |