Does anyone know if we can select the Previous/Next button in a multi step form with JavaScript?
I have a form that accepts file attachments and I have a workflow for it that is triggered by button I added through metadata. The problem is that workflow runs before the record is saved with the attachments. I'm trying to get around this by forcing the page the save somehow.
I've done something similar with other buttons but can't seem to get it to work for the Next/Previous buttons.
Example below will successfully click the workflow button:
You can integrate cloud flows with Power Pages and this will get the response of the flow in real-time. You have to trigger it via JavaScript, but it works Sync: Trigger clouds flows from Power Pages - YouTube
Not sure if you are passing a file via body, but I had issues before due to HTTP request being too long
Thanks, Saud! I think I tried every possible way to write that incorrectly.
Workflows as buttons kind of suck for this reason, as there is no save of the current data on the form prior to the workflow triggering.
You could also consider setting the Yes/No in question inside the forms Validator (these validations get evaluated on Next) - couple of different examples on this page https://learn.microsoft.com/en-us/power-pages/configure/add-custom-javascript#additional-client-side-field-validation
Hey Oliver,
I was trying to use a real time workflow to trigger a cloud flow I built that uses the attached file. However, the record not saving before running the WF messed up that plan. Now I'm trying to create a custom button on the step that will set a yes/no field then save the record to start the flow.
So, my next step is finding out how to had a button that will set that field and then use the script provided by Saud to save the record.
Hi, what is your workflow doing? would you consider Cloud Flows for that?
Hi @GhostPickle ,
You can do the same for Next and Previous buttons available on your multi step form as you are doing above. Inspect your form to get id of button and call jQuery to perform click.
To get button id, do this:
To call click event, you can do the same.
$("input#NextButton").click();
$("input#PreviousButton").click();
Feel free to share if you have any questions.
Thanks,
Saud
If you like this post, give a Thumbs up. Where it solved your request, Mark it as a Solution to enable other users find it.
Lucas001
60
Super User 2025 Season 2
Fubar
55
Super User 2025 Season 2
surya narayanan
35