This topic was automatically generated from Slack. You can find the original thread here.
is there any way I can pull the URL of the page where the form from webflow was coming from, using the event id through JS code?
This topic was automatically generated from Slack. You can find the original thread here.
is there any way I can pull the URL of the page where the form from webflow was coming from, using the event id through JS code?
To pull the URL of the page where the form from Webflow was submitted, you can use the Webflow API to fetch the form submission details. However, Webflow’s API does not directly provide the page URL in the form submission data. Instead, you might need to include a hidden field in your form that captures the page URL when the form is submitted. Here’s how you can achieve this: 1. Add a hidden field to your Webflow form: - In your Webflow Designer, add an HTML Embed element inside your form. - Insert the following code to capture the current page URL: <input type="hidden" name="page_url" value="" id="page_url"> <script> document.getElementById('page_url').value = window.location.href; </script>
2. Fetch the form submission data using Pipedream: - Use the Webflow API to fetch the form submission details, including the hidden field value. Here’s an example Pipedream component to fetch the form submission details using the Webflow API: import { axios } from "@pipedream/platform"; export default defineComponent({ props: { webflow: { type: "app", app: "webflow", }, formSubmissionId: { type: "string", label: "Form Submission ID", }, }, async run({ steps, $ }) { const response = await axios($, { url: `https://api.webflow.com/collections/{collection_id}/items/${this.formSubmissionId}`, headers: { Authorization: `Bearer ${this.webflow.$auth.oauth_access_token}`, "accept-version": `1.0.0`, }, }); // Extract the page URL from the form submission data const pageUrl = response.data.fields.page_url; return { pageUrl }; }, });
Replace {collection_id}
with your actual Webflow collection ID. This component fetches the form submission details using the Webflow API and extracts the page URL from the hidden field. Make sure to add the hidden field to your Webflow form as described above to capture the page URL.
based on the instructions above what is the input for “Form Submission ID”?
To provide you with the correct input for “Form Submission ID,” I need a bit more context. Specifically, could you let me know which app or service you’re referring to? For example, are you working with a specific form service like Google Forms, Typeform, or another service? Additionally, if you have any specific details about the workflow or the component you’re using, that would be very helpful. This will allow me to give you a more accurate and tailored answer. Could you please provide more details?