Hi There,
I am building an app where I would like the user to be able to add products, then create a campaign and add products that they have created to the campaign. I have two data types, one for products and one for campaigns. What is the best way to do this? I created a form with a repeating group that displays the users products and has checkboxes, but can’t figure out how to add the products with a checked checkbox to the campaign data.
could do this a few ways
- have a popup to show the user the products they’ve created and allow them to select them, on popup close write the selection to the pages campaign
- have repeating groups on the page to show the users products and the selected products and an icon to add/remove them writing to the campaign on each add/remove
option 1 is the more efficient
for option 1 use a few states in the popup
state to store selected list of products
when user selects or removes products then update the state
use event “popup closed” to then trigger a state “selected” to change to yes
on the campaign page add a workflow “when popup selected is yes” to write the selected items to the campaign
you may also need a clearing list logic, otherwise the popup will show the same list next time it is opened (unless page refreshed)
alternatively you can send the campaign to the popup and write the selection to the campaign each time something is selected… it’s less efficient but an option.