Skip to end of banner
Go to start of banner

SnapLogic Update

Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 36 Current »

On this Page

Snap type:

Write


Description:

This Snap updates an asset with the information from another asset of the same type.

Prerequisites:

[None]


Support and limitations:

Works in Ultra Task Pipelines.

Account: 

Accounts are not used with this Snap.


Views:
InputThis Snap has exactly one document input view.
OutputThis Snap has at most one document output view.
ErrorThis Snap has at most one document error view and produces zero or more documents in the view.

Settings

Label


Required. The name for the Snap. You can modify this to be more specific, especially if you have more than one of the same Snap in your pipeline.


Asset type



Required. Select the type of asset that you want to update from the following options:

  • ACCOUNT

    The account that is read from the SnapLogic Read snap or the API, encrypts the password field. When the Snap finds additional fields "key" and "fp" associated with the account, the fields are automatically encrypted. Therefore, we recommended you to add the (null: $property_map.settings.password.key) properties in the Mapper Snap upstream of the SnapLogic Update Snap:

    • When changing the password, we recommend you to remove the "key" field in the password property—the Snap then encrypts the password in plaintext and updates it.

    • If your org is configured for Enhanced Account Encryption, the information you use to update an ACCOUNT is automatically encrypted.

  • PIPELINE
  • PROJECT (used for both projects and project spaces)
  • TASK
  • SNAPLEX

Default value: ACCOUNT

Asset path


Required. Absolute path for the asset in the form of: <org>/<project_space>/<project>/<asset>

Examples: /myorg/Engineering/Status/LatestDefects

Default value: [None]

Snap execution

Select one of the three modes in which the Snap executes. Available options are:

  • Validate & Execute: Performs limited execution of the Snap, and generates a data preview during Pipeline validation. Subsequently, performs full execution of the Snap (unlimited records) during Pipeline runtime.
  • Execute only: Performs full execution of the Snap during Pipeline execution without generating preview data.
  • Disabled: Disables the Snap and all Snaps that are downstream from it.

Starting from version 4.27, Metadata Snaps validate Pipeline fields against the schema. If a SnapLogic Create Snap or a SnapLogic Update Snap would modify an existing Pipeline schema, an error is thrown to avoid affecting downstream processes that depend on the same Pipeline schema.

Examples


Updating a Snaplex Programmatically

This simple example demonstrates how you can use the SnapLogic Metadata Update Snap to programmatically update Snaplex information.

 Updating a Snaplex Programmatically

The Snaplex for this Pipeline is called Test. Because other Snaplexes might share the same environment name, you might want to rename the Environment.

In the SnapLogic Read Snap, set the Asset Type to Snaplex and specify the path.

In the Mapper Snap, you select the Input Schema element environment, and enter the expression to change the Environment name.  Note that the Pass through option is selected.

In the Update Snap, you write the changes to the Snaplex and specify its file path.

When you go to the target folder in SnapLogic Manager, you can see that the Snaplex Environment name is changed.


Managing Access Permissions to Projects and Project Spaces Programmatically

This example demonstrates how you can use the SnapLogic Metadata Update Snap to programmatically manage user access or group access permissions to a project or project space.

 Managing Access Permissions to Projects and Project Spaces Programmatically
 Updating User and Group Access Permissions to a Project or Project Space Programmatically

Updating User and Group Access Permissions to a Project or Project Space Programmatically

This example helps you create a pipeline which will, when executed, update the access permissions of a specific user or group to a project or project space.

Download and open the Permissions_Updater sample pipeline and review its structure to better understand this example.

This task primarily involves updating the "acl" (access control list) values associated with the project concerned. To do so, you need to:

  1. Read the project's existing permissions information.
  2. Append new permissions information.
  3. Update the project with the new permissions.

You can perform all these tasks by creating a permissions manager pipeline. To create a permissions manager pipeline:

  1. Create a project and add a pipeline to the project.
    Now that your pipeline is created, you need to specify the variables–and corresponding values–that you plan to use in the pipeline Snaps. In this scenario, you have two variables: the email ID of the user or group whose permissions you need to specify, and the project or project space to which you want to grant access. To specify these variables:
  2. Click the  button on the Pipeline Toolbar to display the Pipeline Properties popup.
  3. Update the Parameters fieldset of the Pipeline Properties popup as follows:
    1. Declare a variable that will contain the new user's email ID.
      1. Key: new_user
      2. Value: <Email ID of the new user / group>
    2. Declare a variable that contains the path to the project that you want to update.
      1. Key: project_path
      2. Value: <Path to the project / project space that you want to update. Structure: /<organization>/<project_space>/<project_name>
  4. Save your changes and close the popup.



    You have now listed out the email ID of the user / group whose permissions you want to update, and you have identified the project / project space on which these permissions must be applied. You now add a Snap that will read the identified project's existing user permissions. To do so:

  5. Add a SnapLogic Read snap to the pipeline and update it using the following details:
    • Asset Type: PROJECT
    • Asset Path: (Click the  button before adding the value.) _project_path. This is a reference to the pipeline parameter that we created in Step 3 above.

    Save your changes and close the popup.



    When this Snap is executed, it retrieves all the data related to the project / project space, including its permission details.

    You now need to append new permissions to the existing ones. To do so:

  6. Add a Mapper Snap to the pipeline and update the following fields:
    1. Expression: Enter the following expression:

      This expression contains the new permission values that you want to add under the "acl" key in the project. Depending on the actual permissions you want to assign to the user, remove 'R', 'W', or 'X'.

    2. Target Path: $acl

      Save your changes and close the popup.



      You can see in the screenshot above that while the Input preview data field lists only one set of permissions, the Output preview data lists two permission sets. The second one is the new permission set added.

      You now have all the details needed to update the project properties retrieved using the SnapLogic Read Snap. To update the project:

  7. Add a SnapLogic Update Snap to the pipeline and update the following fields:
    1. Asset Type: PROJECT
    2. Asset Path: (Click the  button before adding the value.) _project_path
      Save your changes and close the popup.



Once this Pipeline is executed, the project located at _project_path will be updated with the revised permissions specified in the Mapper Snap in Step 5 above. You can now flexibly update the properties of any project / project space from the same pipeline by changing any of the following values:

LocationVariableDescription
Pipeline Parametersnew_userThe email ID whose permissions need to be managed.
project_pathThe path of the project / project space to which you want to assign permissions.
Mapper Snap'R','W','X'The permissions you want to grant to the user defined in new_user.
 Updating Access Permissions of Multiple Users or Groups to Multiple Projects or Project Spaces Programmatically

Updating Access Permissions of Multiple Users or Groups to Multiple Projects or Project Spaces Programmatically

This example helps you create a pipeline which will, when executed, update the access permissions of multiple users or groups to multiple project spaces.

Download and open the Multiple_Permissions_Updater ZIP file and review its structure to better understand this example.

This task primarily involves updating the "acl" (access control list) values associated with the project space concerned. To do so, you need to:

  1. List out the various users and groups to whom you want to apply new permissions, along with the projects or project spaces on which these permissions are applicable.
  2. Read each project's existing permissions information.
  3. Append the new permissions.
  4. Update the projects with the new permissions.

You can perform all these tasks by creating:

  • A parent pipeline that takes a CSV file containing user email IDs and project permission details as input, and
  • A child pipeline that applies the access permissions received from the parent pipeline.

Creating the Parent Pipeline

To create the parent pipeline:

  1. Add a CSV Generator Snap and add user details and associated project permissions as shown below:



    For an example of the CSV data, see the permissions.csv file in the ZIP file you downloaded.
  2. Add a CSV Formatter and a CSV Parser Snap. These Snaps read the CSV data and prepares it for use in the downstream Snap.
  3. Add a Pipeline Execute Snap and configure it as shown below:



    Basically, your configurations trigger a child pipeline called Permission_Updater and pass user and project information from the input CSV file to the child pipeline.
  4. Save the pipeline.

Creating the Child Pipeline

  1. Create a project
  2.  and add a pipeline
  3.  to the project.

    Now that your pipeline is created, you need to specify the variables–and corresponding values–that you plan to use in the pipeline Snaps. In this scenario, you have two variables: the email ID of the user whose permissions you need to modify / create, and the project space to which you want to grant access. To specify these variables:
  4. Click the  button on the Pipeline Toolbar to display the Pipeline Properties popup.
  5. Update the Parameters fieldset of the Pipeline Properties popup as follows:
    1. Declare a variable that will contain new users' email IDs
      1. Key: new_user
      2. Value: <Email ID of the new user>
      1. Key: project_space_path
      2. Value: <Path to the project space that you want to update. Structure: /<organization>/<project_space>

        The data in the Values fields are actually placeholders, placed there because Value is a mandatory field. The actual user and project data comes in from the parent pipeline.
  6. Save your changes and close the popup.



    You have now configured the new pipeline to take user and permissions input from the parent pipeline. You now add a Snap that will read each project's existing user permissions. To do so:

  7. Add a SnapLogic Read snap to the pipeline and update it using the following details:
    • Asset Type: PROJECT (You do not need to change this value even if you are updating permissions for project spaces.)
    • Asset Path: (Click the  button before adding the value.) _project_path. This is a reference to the pipeline parameter that we created in Step 3 above.

    Save your changes and close the popup.



    When this Snap is executed, it retrieves all the data related to each project listed out in the parent pipeline CSV file, including its permission details.

    You now need to append new permissions to the project. To do so:

  8. Add a Mapper Snap to the pipeline and update the following fields:
    1. Expression: Enter the following expression:

      This expression contains the new permission values that you want to add under the "acl" key in each project / project space. Depending on the actual permissions you want to assign to the user / group, remove 'R', 'W', or 'X'.

    2. Target Path: $acl

      Save your changes and close the popup.



      You can see in the screenshot above that while the Input preview data field lists only one set of permissions, the Output preview data lists two permission sets. The second one is the new permission set added.

      You now have all the details needed to update the project properties received from the parent pipeline. To update each project space with the revised permission details:

  9. Add a SnapLogic Update Snap to the pipeline and update the following fields:
    1. Asset Type: PROJECT
    2. Asset Path: (Click the  button before adding the value.) _project_path
      Save your changes and close the popup.



Once this pipeline is executed, each project located at _project_path will be updated with the revised permissions specified in the Mapper Snap in Step 5 above. You can now flexibly update the properties of any project from the same pipeline by changing any of the following values:

LocationVariableDescription
Pipeline Parametersnew_userThe email ID whose permissions need to be managed
project_pathThe path of the project to which you want to assign permissions
Mapper Snap'R','W','X'The permissions you want to grant to the user defined in new_user

Enable/Disable a Task using SnapLogic Update

In this example, you create a Pipeline that enables or disables a Task.

Download this Pipeline.

 Understanding the pipeline

For this example, you create a sample Task Pipeline that writes today's date to a file in the SnapLogic database. You then make it available as a Task. For details on creating Tasks, see the Tasks page.

You now design a Pipeline that can change the status of the Task you created above. This Pipeline comprises the following Snaps:

  1. SnapLogic Read: Reads the asset to be updated; in this case, a task.
  2. Mapper: Updates the task's properties and passes the updated information to the downstream Snap.
  3. SnapLogic Update: Updates the Task read by the SnapLogic Read Snap using the Task details received from the Mapper Snap.

You configure the Snaps as follows:

  1. You configure the SnapLogic Read Snap to read the Task you created in the beginning:



    The Snap reads the target Task and offers its details as input to the Mapper Snap.

  2. You configure the Mapper Snap to update the parameters.enabled attribute of the Task to false. You also instruct the Snap to pass the input data over to the output



    The Task parameter enabled is now set to false

  3. Use the SnapLogic Update Snap to change the task's properties using the updated details.



    This Snap uses the output of the Mapper Snap to update the target task's properties.

To verify whether the Task has been updated as expected, navigate to the project that contains the Task in SnapLogic Manager, click the  icon adjacent to the Task, and click Details.

Download this Pipeline.

Downloads

Important steps to successfully reuse Pipelines

  1. Download and import the Pipeline into SnapLogic.
  2. Configure Snap accounts as applicable.
  3. Provide Pipeline parameters as applicable.

  File Modified
You are not logged in. Any changes you make will be marked as anonymous. You may want to Log In if you already have an account.
No files shared here yet.
  • Drag and drop to upload or browse for files
  • Snap Pack History

     Click to view/expand
    ReleaseSnap Pack VersionDateTypeUpdates
    February 2024main25112 StableUpdated and certified against the current SnapLogic Platform release.
    November 2023main23721 StableUpdated and certified against the current SnapLogic Platform release.

    August 2023

    main22460

     

    Stable

    Updated and certified against the current SnapLogic Platform release.

    May 2023main21015 StableUpgraded with the latest SnapLogic Platform release.
    February 2023main19844 StableUpgraded with the latest SnapLogic Platform release.
    November 2022main 18944 StableUpgraded with the latest SnapLogic Platform release.
    August 2022main17386 StableUpgraded with the latest SnapLogic Platform release.

    4.29

    main15993

      

    Stable

    Upgraded with the latest SnapLogic Platform release.

    4.28main14627 StableUpgraded with the latest SnapLogic Platform release.

    4.27

    main12833

     

    Stable

    Upgraded with the latest SnapLogic Platform release.
    4.26main11181
     
    StableUpgraded with the latest SnapLogic Platform release.
    4.25main9554
     
    StableUpgraded with the latest SnapLogic Platform release.
    4.24main8556
     
    StableUpgraded with the latest SnapLogic Platform release.
    4.23main7430
     
    Stable

    Upgraded with the latest SnapLogic Platform release.

    4.22main6403
     
    StableUpgraded with the latest SnapLogic Platform release.
    4.21snapsmrc542
    StableUpgraded with the latest SnapLogic Platform release.
    4.20snapsmrc535
    StableUpgraded with the latest SnapLogic Platform release.
    4.19snapsmrc528
    Stable

    The SnapLogic Read Snap now features the Normalization checkbox, which, when selected, makes Pipeline comparisons easier.

    4.18snapsmrc523
    Stable

    Enhanced all the Snaps in this Snap Pack with the capability to create, delete, and update Snaplexes directly inside the Pipeline. This feature facilitates administrative tasks if you are running your Pipelines on a Groundplex.

    4.17 PatchALL7402
    Latest

    Pushed automatic rebuild of the latest version of each Snap Pack to SnapLogic UAT and Elastic servers.

    4.17snapsmrc515
    Stable

    Added the Snap Execution field to all Standard-mode Snaps. In some Snaps, this field replaces the existing Execute during the preview check box.

    4.16 snapsmrc508
    StableUpgraded with the latest SnapLogic Platform release.
    4.15snapsmrc500
    StableUpgraded with the latest SnapLogic Platform release.
    4.14 snapsmrc490
    StableUpgraded with the latest SnapLogic Platform release.
    4.13snapsmrc486
    StableUpgraded with the latest SnapLogic Platform release.
    4.12snapsmrc480
    StableUpgraded with the latest SnapLogic Platform release.
    4.11snapsmrc465
    Stable

    Read Task output includes task history.

    4.10snapsmrc414
    StableUpgraded with the latest SnapLogic Platform release.
    4.9snapsmrc405
    StableUpgraded with the latest SnapLogic Platform release.
    4.8.0snapsmrc398
    Stable
    • Support for Project and Project Spaces as an Asset Type added to SnapLogic Create, SnapLogic Delete, SnapLogic Read, and SnapLogic Update. This is used for both projects and Project Spaces.

    • Support for the pipeline as an Asset Type added to SnapLogic Update.

    • Support for enabling/disabling tasks added to SnapLogic Update.

    4.7snapsmrc382
    StableUpgraded with the latest SnapLogic Platform release.
    4.6snapsmrc362
    Stable

    Upgraded with the latest SnapLogic Platform release.

    4.5.0snapsmrc344
    Stable

    Introduced in Release 4.5. This Snap Pack contains the following Snaps: SnapLogic Create, SnapLogic Delete, SnapLogic List, SnapLogic Read, SnapLogic Update.

    • No labels