Pass multiple URL Parameters

Hi All,

I have 2 lists..... Parent & Child

I need to pass a number of parameters from the parent list to the child list to fill certain lookup fields automatically.

In the parent list I have a button to open a new Form in Child list

How can I please:

  1. Pass multiple parameters in URL
  2. Read URL parameters in the Child Form and fill up the lookup fields or variables

Thanks a lot in advance :slight_smile:

A Small update on this.

I am passing parameters as follows from a Normal non Plumsail Form in our sharepoint

var getParameterByName = function(parameter) {
parameter = parameter.replace(/[/, "\[").replace(/]/, "\]");
var regex = new RegExp("[\?&]" + parameter + "=([^&#]*)");
resultArr = regex.exec(location.search);
return resultArr === null ? "" : decodeURIComponent(resultArr[1].replace(/+/g, " "));
}

var itemID = getParameterByName('ID');

var str1 = "https://tenant.sharepoint.com/sites/crm/Lists/Stock%20Code%20Request/NewForm.aspx?ID=";

var url = str1.concat(itemID);
url = url.concat("&test=abcd");

window.open(url);

Problem is that in in Plumsail then the link is opening as follows

https://tenant.sharepoint.com/sites/crm/SitePages/PlumsailForms/Stock%20Code%20Request/Item/NewForm.aspx?item=13808)

If one looks at the url.... the ID is correct but has been changed to item = and not as it was passed as ID = but the other parameter test=abcd has vanished.

Can you please help me out. I need this functioning ASAP :frowning:

@Nikita_Kurguzov & @mnikitina can you help me please?

Dear @Daniel_Privitelli,
Are you opening the form in dialog from a parent form? In this case, you don't need the URL params, you can just grab values from the parent form as described here - Pass SharePoint values to a dialog form — SharePoint forms

Hi @Nikita_Kurguzov,

No the parent form is a normal non-plumsail form. At the moment its too much hassle to convert to Plumsail, in the future we will look into it though.

However I need a solution for the time being to pass parameters in the URL for a Child List using Plumsail as Interface. That's the reason why I am trying to pass them as parameters.

Do you think it is possible?

Dear @Daniel_Privitelli,
How exactly are you opening the Plumsail Form?

@Nikita_Kurguzov

There is a button in the Parent Form (Non-Plumsail) sending the following

var str1 = "https://tenant.sharepoint.com/sites/crm/Lists/Stock%20Code%20Request/NewForm.aspx?ID=";

var url = str1.concat(itemID);
url = url.concat("&test=abcd");

window.open(url);

ItemID I'm getting the ID using another function which is working perfectly

Using the above code, it is opening the plumsail form but the url is changing. No problem with that. The problem is that ID = is changing to item = and the other parameter (test=abcd) is vanishing.

Then in plumsail form I am using the following code

fd.spRendered(function() {

$.urlParam = function(name){
	var results = new RegExp('[\?&]' + name + '=([^&#]*)').exec(window.location.href);
	return results[1] || 0;
}

fd.field("OpportunityID").value = $.urlParam('item');

Problems

  1. I had to change $.urlParam('item'); from ID to item or else it wouldn't recognize it
  2. I then want the other parameters to fill other fields but the other parameters are not being passed in the Plumsail URL

Dear @Daniel_Privitelli,
You can just use a direct link to form, something like this:
https://tenant.sharepoint.com/sites/dcrmv/SitePages/PlumsailForms/Stock%20Code%20Request/Item/EditForm.aspx?item=1&test=abcd