cancel
Showing results for 
Search instead for 
Did you mean: 
Workflow Hero

Display content in multi-line field (text)

I have a requirement to display content into a multi-line field (Plain text) in real-time, based on end user selection in a look-up field “drop-down”. I’m able to pull the content by using the look-up functionality in a calculated value expression. I’d like the ability to copy the calculated value over to multi-line field.   Is there a way within Nintex to copy content from calculate value into the multi-line?

 

Any help on this will be appreciated.

 

Rene

Labels: (2)
0 Kudos
Reply
2 Replies
Workflow Hero

Re: Display content in multi-line field (text)

You need to use JavaScript/JQuery to get the change on your dropdown and copy to another field.

In your dropdown, declare in the field settings a "Client ID JavaScript variable name" and in your form setting, put the treatment about the change of your dropdown based on the client ID.

0 Kudos
Accept as Solution Reply
Workflow Hero

Re: Display content in multi-line field (text)

Hi Rene,

François THOMAS is right, you need JavaScript to get what you want.

But as you want a lookup content, it may be tricky to write the code if you don't know JS well.

Here's a way to achieve your goal.

Add a CSS class "lookup-selector" on the SharePoint Lookup control in your form.

Add another CSS class "lookup-content" on the multi-line control in your form.

Then, adapt the following code with the right field and list names and add it in the custom JavaScript section of the form settings.

NWF.FormFiller.Events.RegisterAfterReady(function ()

{

  NWF$(".lookup-selector select").bind("change",function()

  {

  var clientContext = new SP.ClientContext.get_current();

  var oList = clientContext.get_web().get_lists().getByTitle("ReneLookupList");

  var camlQuery = new SP.CamlQuery();

  camlQuery.set_viewXml('<View><Query><Where><Eq><FieldRef Name="ID"/><Value Type="Integer">'+$(this).val()+'</Value></Eq></Where></Query></View>');

  var matchingItems = oList.getItems(camlQuery);

  clientContext.load(matchingItems, "Include(MultipleLineField)");

  clientContext.executeQueryAsync(

  Function.createDelegate(this, function ()

  {

  if (matchingItems.get_count() > 0)

  {

  var matchingItem = matchingItems.getItemAtIndex(0);

  $textarea = NWF$(".lookup-content textarea");

  $textarea.val(matchingItem.get_item("MultipleLineField"));

  }

  }),

  Function.createDelegate(this, function ()

  {

  console.log('error loading data from ' + "ReneLookupList");

  })

  );

  });

});

0 Kudos
Accept as Solution Reply