Jump to content
  • 0

In a Lookup Table, sort by a third field, not Value or Display


JohnM

Question

Is it possible, in the Lookup Table that populates a Dropdown, to sort not by the “Field for display” or the “Field for value” but by some other field in the “Table or view”?

 

 

image.png.ed9d6dbddd49c214714631af2fc02ace.png

In my case, I don’t want to reenter (and change when needed) the options in a Dropdown as custom values, in all the places I use this Dropdown. I want to store the options in a table and re-use as needed. But I need a sort order that is not alphabetical. I expected the “Sort by” to list fields, but it does not.

image.png.042c64ed617f245e1ec1480ca1871eb1.png

Link to comment
Share on other sites

9 answers to this question

Recommended Posts

  • 0

Hi @JohnM,

so you want the options to be ordered by the Display_Order, right? I suggest you use the Display_Order on the "Field for value" then change the "Sort by" to "Value", but I think the reason why you chose "Type_of_Item" for both "Field for value" and "Field for display" is because you want to save the actual value instead of the display order number. With that being said, may I also suggest creating a relationship between Types_of_Archival_Items and the data source for the DataPage you are creating and link them together based on the field, and enable the "Use display view on DataPages" so you should still be able to see the value tied to the selected item (even if the Display_Order is the saved value):

image.png.146bb2edbc17c3be91e51b0ca40cf5f6.png

I hope that made sense!

Link to comment
Share on other sites

  • 0
51 minutes ago, JohnM said:

 

Yes, in Type_of_Item I want to save the string “Letter” or “Email” or whichever,  not the Display_Order integers.  Would your approach let me do that?

 

@futurist's approach may not let you do that directly but you can use a Virtual field for the dropdown and do what @futurist did to be able to sort the options by sort order then for the actual field, make it's form element a "Calculated Value" and use a SELECT statement to save the string instead of the number.
image.png.b108fc106a1a8521f65baee05d19f449.png
image.png.ff698048321103a5c614c374eeda9b26.png

Should look something like this when previewed.
image.png.e4751b76ead65ccd702217d8ed18745e.png
Then you can just hide the actual field in the Advanced section, just check "Hide field". It will still save don't worry.

Link to comment
Share on other sites

  • 0

I think I see. It’s roundabout but might work.

Is there a better way to handle a case where the same drop-down options are used in several places in the app? For maintainability,  it would be good to store the list (and its order) in one place. 

I really expected “Sort by” here to allow sorting on any field in the selected table or view. 

 image.png.ed9d6dbddd49c214714631af2fc02ace.png

Link to comment
Share on other sites

  • 0

Another option... still a bit cumbersome. 

If you select 'Sort By: None', it will sort the values by the order in which they were inserted into the table. Which, by looking at your first screenshot, it seems you already have that in place.

Instead of changing order/adding new values to Custom Values in every dropdown, you would change the values in the table once. This can be done manually... or you can have an excel spreadsheet or something where you can edit your values there and then use the Import feature to set your Caspio table.

Link to comment
Share on other sites

  • 0

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...