Jump to content
  • 0

Updating table with drop down list.


David17

Question

Users choose 1 option from the drop down listing of event descriptions. In the drop down box definition we have "Field for value" as the numeric id which is stored in the table.  However we also want to put the Event description in the table. There is only one field for "Field for value" so how can we move both the event description chosen and the event id to the table?

Link to comment
Share on other sites

5 answers to this question

Recommended Posts

  • 0

Hi @David17,

Is this for a submission form?

There are a couple of solutions that came to my mind. The first being, you can add the Event Description field to the page you are using and set it as Cascading Text Field. For this field, set the 'Parent Field' as the dropdown you already have that uses ID for the value. Then, select the Lookup table or view that is related, set 'Filter Cascade By' to the ID field, and for value set it as the description. You can wrap this field in HTML blocks with a <div style="display:none;"> if you want to hide the field but still record the value.

https://howto.caspio.com/datapages/datapage-components/cascading-elements/

2nd way is to set it up on an Insert Trigger on your table. You can make an insert trigger with an update block that updates the #inserted Event Description field where the #inserted.EventDescriptionID = EventDescriptionID. This would update the field right after you click submit.

https://howto.caspio.com/tables-and-views/triggered-actions/

3rd way, if you want the ID and description in the same field and not separate, you can create a new field in your table that is either a formula field that concatenates ID and Event Description, or a text field and create a trigger that gives it the concatenated value. 

https://howto.caspio.com/tables-and-views/data-types/formula-fields/

Hope this helps.

Link to comment
Share on other sites

  • 0

This looks really good! I am half-way there. I am trying to hide the field on the submission form. I put an html (I don't know html) block before the field and after. I clicked on source and typed in <div style="display:none;"> but Caspio changed it to <div style="display:none;"></div>. I tried putting just </div> in the 2nd html block. Can't seem to get it to work.

Link to comment
Share on other sites

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...