Jump to content
  • 0

Multi-Select in Submission form


NickO

Question

I have two normalized tables, Content and Product. They are linked by a DescriptionContent table. I have a form that allows me to link the a single Product to a single Content. That form automatically gets the ProductID via a parameter. I am trying to find a way to associate multiple items from the Content table to that Product in a single data page. Does anyone have any thoughts?

Link to comment
Share on other sites

5 answers to this question

Recommended Posts

  • 0
8 hours ago, NickO said:

I have two normalized tables, Content and Product. They are linked by a DescriptionContent table. I have a form that allows me to link the a single Product to a single Content. That form automatically gets the ProductID via a parameter. I am trying to find a way to associate multiple items from the Content table to that Product in a single data page. Does anyone have any thoughts?

What do you mean by to associate? do you want to have like a lookup field to the other table?

Link to comment
Share on other sites

  • 0

Sorry Perzival, just saw this. I noticed a typo above with likely didn't help.  The three tables are Content, Product and ContentProduct. Say Content has fields ContID, Name, Description and Records C1, C2, C3, C4. Product has fields ProdID and Name and records P1, P2, P3, P4. ContentProduct allows me to link them together so a record in ContentProduct would have fields ContID and ProdID and link the two together.

Specific to my question. If I want to create three rows in ContentProduct that contain C1,P1; C2,P1; and C3,P1 is there a way to do this without the user having to select each Content record and click add through a new record (or other) Data Page?

Link to comment
Share on other sites

  • 0
Hi NickO, if I understand it correctly, you want to implement this using a single DataPage. One workaround for this is by using a Triggered Action. You need to create a Reports DataPage (Tabular) for your Content table and enable Bulk Edit. You will need a new field in your Content table to store a ProdID. You'll use this new field in the Bulk Edit so your users can select (using dropdown, autocomplete or other form element) which Product the selected Contents be related to. Then, you need to create an on update trigger in your Content table that will insert the updated records (#inserted) to your ContentProduct table  ContID = #inserted.ContentID and ProdId = #inserted.newfield. 
By using the trigger, you will be able to insert multiple records in your ContentProduct table (associate multiple Content to a Product) when several records are updated via Bulk Edit.
Link to comment
Share on other sites

  • 0

Hmmm...that is one way to address it, but if I have multiple different types of entities I want to associate the Content to, then I have to add a column for each type to the table. I would also have to remove the value the user selected from the table when the Triggered Action was run.

I.E.

  • User chooses P1 for C1, C2 and C3.
  • Triggered Action writes combo to ContentProduct table, creating 3 new records.
  • Triggered action removes P1 reference from C1, C2 and C3 in Content table.

 

Yes it would techincally work, but is pretty kludgy. Is there any way to do a control like the one attached? Basic flow would be as follows

  • User chooses product and is brought to a screen like this which lists all available content in on box
  • User selects Content to associate to product (or removes) as necessary and list on right is populated
  • User submits changes and entries are created in the ContentProduct table

multiple select example.png

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