Hi everyone, I have dynamic pages and would like a way to identify enquiries submitted from those pages. So if a form on a dynamic page is submitted, I know the enquiry is in relation to that particular dynamic page. Does any one know if this can be done, please?
top of page
Important forum update
This forum is migrating to one unified Wix community forum starting July 26th, and will be read-only during the process.
Wishlist Page is the official platform for requesting new features. You can vote, comment, and track the status of the requested features.
bottom of page
If you create a form using code, and submit it to a database, then it's simple.
You create a field in your referral database, a reference field that is linked to the blog database (of the dynamic pages).
Then in the response form they send you also send the page ID to the reference field.
That's about the process
import wixData from 'wix-data'; export function button1_click(event, $w) { let insert ={ "Comment" : $w('#input1').value, "item" : $w('#dynamicDataset').getCurrentItem()._id } wixData.insert("Comments", insert) }
I can't see your site-project, so i can not do much.
Perhaps a pic or a part of your site, where i can look at?
So i would try to reconstruct a piece if possible.
A little bit difficult to imagine your site structure. Do you made all without code? So if you want to use codelines, then probably the following code-snipets could probably help you...
let itemIndex = $w("#myDataset").getCurrentItemIndex(); // 3
But i don't know if that works also on dynamic pages, besause it is alwasy just one page, not sure.
The customer/byer clicks on "OK" or "Submit" or what ever, and boom you have the right/current indexRow in your DATABASE.
Then you take this INDEX and do a DATABASE-QUERY.
import wixData from 'wix-data'; wixData.query("myCollection") .find() .then( (results) => { if(results.items.length > 0) { let firstItem = results.items[0]; //see item below } else { // handle case where no matching items found } } ) .catch( (err) => { let errorMsg = err; } );
After this you should now know the page, which was filled out.
Point-b done!
For point-a you can make a triggered-Email, look here....
https://www.wix.com/corvid/forum/community-discussion/trigger-email-from-dashboard-to-member
...and here ....
https://www.wix.com/corvid/forum/tips-tutorials-examples/triggered-emails
I have played a little bit for testing my knowledge and did this little example, which works endeed....
https://russian-dima.wixsite.com/wixworld/blank-10
Hello Steve,
what are dynamic pages? Dynamic pages are just reflections of a DATABASE connected by the help of DATASETs.
So for example you have 10-dynamic pages (all of them some kind of forms which have to be filled by users).
So now you wanna know, which of these 10-forms were filled out by user, right?
So if it is like i have described, so you just need have to know the INDEX of the dataset, right?
For example a user fills out the form-page-6 (currentIndex in the DATASET = 5)
So you always know which form was filled out by user, when he submit.
But perhaps i also did not understand your issue.
When you know the INDEX, then you know everything, because you know the whole current Row in the DATABASE, when you do a DATA-Querry.