Is it possible to use a JS snippet in an Ask Assistant Function block to: a} run the code below on the client or b) execute a block in the flow that currently does this already?
The code:
function parseURL() {
const windowURL = window.location.href;
const allSegments = windowURL.split('/');
const relevantSegments = allSegments.slice(4); // slice starts after third '/'
const modifiedSegments = relevantSegments.map(function(segment) {
return segment.replace(/-/g, ' ');
});
return modifiedSegments;
}
//const splitURL = parseURL();
//const currentURL = JSON.stringify(splitURL);
const currentURL = parseURL();
return currentURL;
Add a reply
Sign up and join the conversation on Discord