Recent Discussions
XML namespace prefix removal from XML document
I would like to remove xml namespace prefix in the XML document for data retrieval. I have tried with mapper with mapKeys(), I cannot use mapper as $Header.['ns2:DocumentHeader']['ns2:Identifier'] because namespace prefix may be different for each records "ns2" as per our vendor. Could you please suggest possible solution for this? Here is my input. <Header> <ns2:DocumentHeader> <ns2:Identifier>3af8318ca9e0</ns2:Identifier> </ns2:DocumentHeader> </Header> Expected Output: <Header> <DocumentHeader> <Identifier>3af8318ca9e0</Identifier> </DocumentHeader> </Header>Solvedvpalan2 months agoNew Contributor545Views0likes2CommentsRenaming multiple items in an array
I have a question regarding renaming multiple items within an array. Currently, I'm using the following mapping to rename one item: ``` map(x => x.mapKeys((value, key) => key.contains('Memo') ? "description" : key)) ``` However, I'm encountering difficulties when attempting to rename another item within the same array ("unique id" to "custcol_xero_unique_key"). I've tried various approaches but keep running into compilation errors. Would you have any suggestions on how to incorporate the renaming of this second array item into the existing formula?AvaniAnand5 months agoNew Contributor527Views0likes1CommentCustom snap development: The snap settings tab is stuck on loading
Hi , I am encountering an issue with snap development. After building the Snappack using mvn clean install, I uploaded the resulting .zip file to the Manager. However, when I try to open the SETTINGS tab for the demo snaps in the Designer, it remains stuck in a loading state. I'm using Java version 11.0.23 and Maven version 3.9.8. I came across another post discussing this issue: Cannot open settings of custom snaps Can anyone help with this issue? Thanks!jiananchen211 months agoNew Contributor786Views0likes0CommentsHow to debug custom snap in editor before snap deployment
Hello Everyone, Could you please tell me that how to debug custom snap in the editor before deployment of snap while snap development ? Currently I am developing one custom snap while developing snap I deploy snap after every little changes So, Is there any way to debug custom snap in editor instead of deployment of snap for debugging for every changes ?Ganeshu10811 months agoNew Contributor II1.8KViews0likes3Commentsnot able to get the third party libs in customsnap Snappack
Hi Team, i am creating custom snap by using some third party libs so those libs i have imported as shown below. step 1: added jar files in lib folder which is located in project root directory. step2: added dependency as sown in below. <library.path>${project.basedir}/lib</library.path> in properties section <dependency> <groupId>com.polarion</groupId> <artifactId>commons-logging-1.0.4</artifactId> <version>1.0</version> <scope>system</scope> <systemPath>${library.path}/commons-logging-1.0.4.jar</systemPath> </dependency> in depedencies section but these jar files are not able access while executing the snap after deploying into snaplogic.those jar files and lib folder not able to see in my snappack pacakge zip can anyone have any idea ?maheswara12 months agoNew Contributor II1.2KViews0likes1CommentCannot open settings of custom snaps
Hi all, I have a problem with the custom snaps after uploading a snap pack in manager. After building the snap package with Maven, I cannot see the settings tab of any custom snap. The snap is forever loading and not showing the settings tab. I tried using Maven versions 3.8.6 and 3.6.3 and Java versions 11.0.17 and 11.0.12. Please see the picture below. Any help is highly appreciated.Emma12 months agoNew Contributor II5.2KViews1like9CommentsUnable to load account definition
Hi Team, I developing custom snap. I am using account type is custom. so now i am written my logic and deployed to snapLogic now i am getting error like below. "Unable to load account definition, Reason: Account named "snap" does not exist, Resolution: Update the account for this snap". Please help in this if anyone knows the solution.Solvedmaheswara2 years agoNew Contributor II3.9KViews0likes8CommentsDeveloping Snaps on Windows via WSL
We recently had a support request received via the support e-mail for snap development and found that the root of the issue (accounts in custom-developed snap packs) was caused by a strange behavior with how Windows (and specifically Windows Subsystem for Linux) sets certain environment variables. I want to highlight the problem, and the final solution if you are developing snap packs on Windows using Windows Subsystem for Linux. First, I want to highlight the portions of the pom file for a snap pack where this comes into play. All of this is happening in the last two plugins for the pom where we're loading the directives file (in your src/main/config folder) to populate runtime properties for the maven antrun plugin to generate a build.properties file (in the target/classes folder) in order to populate certain schema in your bundled snap pack zip file. <plugin> <groupId>org.codehaus.mojo</groupId> <artifactId>properties-maven-plugin</artifactId> <executions> <execution> <phase>generate-resources</phase> <goals> <goal>read-project-properties</goal> </goals> <configuration> <files> <file>src/main/config/directives</file> </files> </configuration> </execution> </executions> </plugin> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-antrun-plugin</artifactId> <version>1.8</version> <executions> <execution> <id>generate files</id> <phase>generate-resources</phase> <configuration> <target> <!-- This will add the build number and version in the resources file. Don't change the formatting below. --> <echo file="${project.build.directory}/classes/build.properties"> build_number=${sl_build} snap_pack_version=${VERSION} snap_pack_fqid=${snap}-snap-${VERSION}-${sl_build}.zip snap_pack_url=$SNAP_HOME/${snap}/target/${snap}-build snap_pack_name=${NAME} </echo> </target> </configuration> <goals> <goal>run</goal> </goals> </execution> </executions> </plugin> I want to explain what these plugins are doing to better understand the what is happening specifically with Windows via Windows Subsystem for Linux. The first plugin (properties-maven-plugin) is loading your directives file (something like below) and converting it into a "properties" file (where the first word is the key the rest of the line is the property value) so that it can be used in downstream plugins and configurations to inject variables into different items. The second plugin (maven-antrun-plugin) is then reading properties (from the environment as well as maven and what we loaded in the first plugin) and then writing a file (in this case the build.properties file in target/classes) with certain values which are coming from pom properties (like ${sl_build} , and ${snap} ) and others are coming from the directives file (like ${VERSION} and ${NAME} ) Example directives file: NAME Snap Pack Name VERSION 1 LANG java ASSET_DIR_PATH /snaplogic/shared For most systems, this has no issue running, in the end the NAME (snap_pack_name in the build.properties) file gets injected into the schema files and that is what powers the connection between accounts and their respective snaps. Windows (and specifically Windows Subsystem for Linux) however throws a bit of a wrinkle into this. Windows loads the hostname of the computer into the %COMPUTERNAME% environment variable (see here) for use in scripts. Windows Subsystem for Linux, however sets this to $NAME which is the cause of the clash that brought me to write up this post. All of the maven plugins will prefer the use of the embedded Environment variable settings over the properties pulled in from any files (so if your machine is setting a NAME environment variable, that will be used over the property in the directives file). The format of the directives file is unable to be changed as it's crucial for the deployment (upload) of the snap pack within your SnapLogic environment. As a result, there are a few ways to override this, but the easiest would be to force a prefix on the environment variables coming through the directives file. To accomplish this (and we will be updating our archetype for the August release with these changes), you'll need to update the properties maven plugin to 1.2.1, this will be present in your properties section within the pom file. <properties-maven-plugin.version>1.2.1</properties-maven-plugin.version> Then you will need to update your last two plugins (listed above) with the following updated settings and configurations: <plugin> <groupId>org.codehaus.mojo</groupId> <artifactId>properties-maven-plugin</artifactId> <executions> <execution> <phase>generate-resources</phase> <goals> <goal>read-project-properties</goal> </goals> <configuration> <files> <file>src/main/config/directives</file> </files> <keyPrefix>directives.</keyPrefix> </configuration> </execution> </executions> </plugin> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-antrun-plugin</artifactId> <version>3.1.0</version> <executions> <execution> <id>generate files</id> <phase>generate-resources</phase> <configuration> <target> <!-- This will add the build number and version in the resources file. Don't change the formatting below. --> <echo file="${project.build.directory}/classes/build.properties"> build_number=${sl_build} snap_pack_version=${directives.VERSION} snap_pack_fqid=${project.artifactId}-snap-${directives.VERSION}-${sl_build}.zip snap_pack_url=$SNAP_HOME/${project.artifactId}/target/${project.artifactId}-build snap_pack_name=${directives.NAME} </echo> </target> </configuration> <goals> <goal>run</goal> </goals> </execution> </executions> </plugin> With these changes, leveraging Windows and Windows Subsystem for Linux to build your project will continue to work as expected. Thank you for lending me your eyes and attention to potentially help with the development and deployment of your own custom snap packs, feel free to reach out if there are questions regarding snap development!1.5KViews2likes0CommentsUsing $.get on properties with forward slash
Hi, We have an array of the following structure: { "/position/fte": { "humanReadable": "100", "value": 100 }, "/position/field_2354914": { "humanReadable": "ALQhtani & Partners", "value": "257532069" }, "/position/field_2355402": { "humanReadable": "fhdfhjf", "value": "fhdfhjf" }, "/position/field_7424424": { "humanReadable": "Indirect", "value": "257905227" }, "/position/field_2355398": { "humanReadable": "Central Operations", "value": "257475809" }, "/position/field_7424427": { "humanReadable": "Support", "value": "257905230" }, "/position/job": { "humanReadable": "Information Technology \\ 2a", "value": 4807663 }, "/position/name": { "humanReadable": "P-1486729", "value": "P-1486729" }, "/position/field_2355401": { "humanReadable": "Birmingham - Snow Hill", "value": "257529525" }, "/position/department": { "humanReadable": "Legal Operations", "value": "257475756" }, "/position/field_2355404": { "humanReadable": "Hybrid Worker", "value": "257781843" }, "/position/field_7424426": { "humanReadable": "Support", "value": "258131652" }, "/position/site": { "humanReadable": "England", "value": 2477909 }, "/position/field_7424425": { "humanReadable": "Support", "value": "258046626" }, "/position/field_2355400": { "humanReadable": "Audit - Australia", "value": "257476016" }, "/position/field_2355399": { "humanReadable": "Business Services", "value": "257475770" } } Not all of the items in the array have the same properties, so I've been looking at using $.get to workaround this. However using something like: $.get("['/position/field_7424425'].value") always returns null. I can use $.hasPath("['/position/field_7424425'].value") to check if it exists and it correctly returns true/false so can use a ternary operator but would prefer to use .get if possible. Can anyone advise?Solvednickhumble2 years agoNew Contributor II16KViews0likes4Comments