assign
  • 20 Dec 2023
  • Dark
    Light
  • PDF

assign

  • Dark
    Light
  • PDF

Article summary

Task Purpose

The assign task is used to copy all the enumerable properties from a source object to a target object. It will return a modified target object, which has properties and values pushed from the source object. Of note, the target object is the first parameter and is used also as the return value (targetObject).

Potential Use Case

Suppose you have an ordered list of emails in a collection and you want to assign them into a numbered list. The target object and the source object will be given the numerical assignments in the final list.

Task Properties

Input and output properties are shown below.

Incoming Type Description
target Object Required. The target object to apply the source properties to.
sourceN Object Required. The source object containing the properties to copy.

Outgoing Type Description
targetObject Object The target object.

How to Configure the Task

In the IAP example below:

  • Property "a" has been assigned the value of "1" in the target object.
  • Property "b" has been assigned the value of "2" in the sourceN object.
  • The source object "b:2" is copied to the target object and the targetObject returns the combined variables of "a":1,"b":2 shown in Figure 3.

Figure 1: Target Object
assign-23.1-ex01


Figure 2: Source Object
assign-23.1-ex02


Figure 3: Output
assign-23.1-ex03

For more related information on the assign task, see the assign API reference.


Was this article helpful?

Changing your password will log you out immediately. Use the new password to log back in.
First name must have atleast 2 characters. Numbers and special characters are not allowed.
Last name must have atleast 1 characters. Numbers and special characters are not allowed.
Enter a valid email
Enter a valid password
Your profile has been successfully updated.