Opening URL from Button Using Field

Hello

Somewhat basic Forms user here - little to no JSS experience.

I have a form based on a SP list, and want a button which will open a new tab (does not need to save the form). The URL of the button consists of a fixed (never changing) with a number at the end which is based on a field in the SharePoint list. Thus in the below example, the number 9 will be a field. Any help would be appreciated.

......f42643f2af&ridx=9

Laurence

Hi @Laurence_Franks1,

Welcome to the community!

You can achieve this by adding a button control to the form and putting this code in it's Click property:

let number = fd.field('NumberField').value;
let url = "......f42643f2af&ridx=" + number;
window.open(url, '_blank').focus();

Make sure to use the full URL starting with https:// if it's not a SharePoint page.

1 Like