Pass value from PlumSail field to SharePoint field

Hello plumsail,

I found this code which can pass a value to another field but it's not working.

This is the Plumsail date field (PSTerminationDate)
The SharePoint Date field is: Effective_Date

//This code will pass a value to the hidden effective date field 
//update common field on form load
fd.field('PSTerminationDate').value = fd.field('Effective_Date').value;
//update sharepoint field on common field change
fd.field('PSTerminationDate').$on('change',function(value){
fd.field('Effective_Date').value = value;
});

If that's not possible, how could I modify the code to pass the value to a single-line text field with a date format such as DD/MM/YYYY?

Dear @DryChips,
Where exactly are you running this code? It should still be inside fd.spRendered() event. Also, check the browser's console for errors.

It's running inside the fd.spRendered() event.

The code works now but it returns this:

image

How can I get it to display in this format: DD/MM/YYYY?

Dear @DryChips,
You can try this:
fd.field('Effective_Date').value.toLocaleDateString();
Though exact date format will depend on the user's system.