I have a form that Users submit. One part of that form is a priority radio selection ranging from 1 - 10.
Within my Gallery I have a list of submitted forms that are able to be sorted via "Title" and "Created" (for date created). This works with the double arrow sort icon no issue. I get stuck when I try to do the same sort technique but with the "Priority" value based off of the radio button selections the User did when filling out the form.
How can I sort my gallery based off of the radio button value from the form?
Solved! Go to Solution.
Sorry for the delay!!
For the Priority, you will need to expose the value in a way that you can sort on it. You can't sort by a choice column directly.
So the formula for the Items property would be:
SortByColumns(
AddColumns('Approval List',
"_priority", Priority.Value
),
varSortColumn,
varSortDirection
)
Then change the formula on the priority sort icon to:
Set(varSortColumn, "_priority");
Set(varSortDirection, If(varSortDirection = Ascending, Descending, Ascending))
I would assume you would be storing the value of the radio control in your data as a number. So you would simply need to sort on that column in your gallery.
If you have a particular formula that is not giving you what you want, then feel free to share it.
I hope this is helpful for you.
For the sort columns that are working properly I have:
Sort by Title:
Set(
varSortColumn,
"Title"
);
Set(
varSortDirection,
If(
varSortDirection = Ascending,
Descending,
Ascending
)
)
Sort by Date Created:
Set(
varSortColumn,
"Created"
);
Set(
varSortDirection,
If(
varSortDirection = Ascending,
Descending,
Ascending
)
)
But when I try to sort by the Priority column that houses the radio selections using the following:
Set(
varSortColumn,
"Priority"
);
Set(
varSortDirection,
If(
varSortDirection = Ascending,
Descending,
Ascending
)
)
Everything just disappears and I am left with a blank canvas. Not all of the values are numerical. I have "1-Low", 5-Medium", "10-High" like shown in the original post. I will try to make the values ONLY numerical and see what happens.
Yes, but those formulas are all setting variables. What is the formula for your Items property of your Gallery?
Still a blank canvas. I checked my SharePoint Lists settings under the Radio section and did not see a way to enforce using numerical values. I am assuming it takes everything as string values?
The formula for my "Items" property within my Gallery is:
SortByColumns(
'Approval List',
varSortColumn,
varSortDirection
)
Thanks for the formula.
So let's focus on your list columns then. First - what is the "real" name of the column?
To determine a column's real name, you can click on the column in the List Settings of your list and then in the address bar of your browser, look at the end of the URL - it will show the real name.
Next, what is the column type in your list - text, numeric, etc?
OR...have you defined this column as a Choice column?
Real name of the column for the radio selections shows "Field=Priority" at the end of the URL.
The column list type is "Choice" with the choice display options as "Radio Buttons"
Been doing some more research and hopefully this info will help find a solution:
I have a gallery that has different sort buttons. I want one of the buttons to sort based off of the "Choice" selection called "Priority". This column pulled from a SharePoint List and the different choices are the numbers 1-10.
'Approval List' = SharePoint List Name
'Priority' = SharePoint List Column [Choice]
numbers "1-10" = the different choices within the Choice column
How can I get my Gallery to sort my info based off of Priority number using a sort button. ***The default sorting filter will not be based off of 'Priority'***
@RandyHayes Haven't heard back from you in a while but I have not been able to find an answer for my question. Based on the new information I provided do you have any more questions or possible solutions for creating a sorting button for [Choice] values?
User | Count |
---|---|
262 | |
110 | |
98 | |
54 | |
39 |