How to avoid double encoding issue for URI in Snaplogic?
While processing a Azure blob storage file in Snaplogic, Snaplogic is not able to read it as its encountering with double encoding issue. I have already tried below method to handle double encoding to fix it and worked well but encountering with other issues due to this. Example URI : “https://myaccount.blob.core.windows.net/sascontainer/sasblob.txt?sv=2015-04-05&st=2015-04-29T22%3A18%3A26Z&se=2017-04-30T02%3A23%3A26Z&sr=b&sp=rw&sip=168.1.5.60-168.1.5.70&spr=https&sig=Z%2FRHIX5Xcg0Mq2rqI3OlWTjEg2tYkboXr1P9ZUXDtkk%3D” Endindex : $data.indexOf(“?”) Startindex : $data.search(“sascontainer /”)+11 Head: $.data.slice(0,$.startIndex) Middle : encodeURIComponent(decodeURIComponent($.data.slice($.startIndex,$.endIndex))) Tail : $.data.slice($.endIndex) Rest GET service URL: Head + Middle + Tail above logic is used in Rest GET to read the service url by decoding and encoding only middle part. However this method is also failing even though it handled double encoding as its decoding everything instead of only decoding hexadecimal values of URL. Is there any other method to decode only those hexadecimal values present in URI and encode whole URI on top of it?3.4KViews0likes3CommentsJSOn body for property with null value
Hi all, I’m having an issue while designing the mapping property with null value for my JSON object. For example I have a Mapper to map $input to $body with the expression like follow: {“my_id”: $input.Id, “my_name”: $input.Name, “my_address”: $input.Address }. When the $input is {“Id”: 123,“Name”: null, “Address”: “A Street, B District, C City”}, the $body should be: {“my_id”: 123, “my_name”: null, “my_address”: “A Street, B District, C City” }. But when the $input is {“Id”: 123, “Address”: “A Street, B District, C City”}, the $body should be: {“my_id”: $input.Id, “my_address”: $input.Address }. I tried with hasOwnProperty() and hasPath(), but they all treats the null value as not existing property, so it will not work. Does anyone know how can I keep the null value for mapping, but eliminate property that does not exist in the $input. Thank you in advanced. best regards.2.9KViews0likes3CommentsHow to get the file name(s) from a Multi File Reader
I have a Multi File Reader reading a series of S3 files using a wildcard, and writing the data to Snowflake. There is a Mapper in between. Functionally, everything is working as expected. I’d like to get the name of the file in which the data was read, and write it to a Meta_FileName column. How do I retrieve the file name from the Multi File Reader? I’m sort of assuming it’s an expression to be added in the Mapper but not sure. TIA!9.2KViews0likes14CommentsMerge two tables based on multiple criteria
Hi there, I’ve been trying to find a solution for our use case with no success, so I’d like to ask the Community for help. We have two tables (both from Salesforce), table A contains deal information, table B contains campaign information. Both table A and B have the following fields: Start Date, End Date, Client1, Client2, Area Code, ID I would like to create a new column in in table B, called “DealId”, and copy the ID field from table A, if all of the following criteria are met: Start Date (B) is equal or greater than Start Date (A) and End Date (B) is equal or less than End Date (A) and Client1 (B) = Client1 (A) and Client2 (B) = Client2 (A) and Area Code (A) contains Area Code (B) So far I’ve tried the Mapper Snap and putting all criteria as an expression but it didn’t work. I have been also experimenting with the Join and Conditional snaps, but unfortunately I still haven’t found any solution yet. Right now in my pipeline I have two filtered documents, but cannot find a solution to add the right deal IDs to campaigns. Please help!Solved4.6KViews0likes3CommentsNeed help with XML data extraction/XML parser
Hello Everyone, I am trying to extract data from a specific xml tags for that I have used XML parser and split field in the snap but for some reason it’s not resulting in any output. I have followed the documentation on the site - https://docs-snaplogic.atlassian.net/wiki/spaces/SD/pages/1439274/XML+Parser but no help. XML tags I am after are – And also <d:Name>,<d:ServerRelativeUrl> Please find attached the XML parser test_2020_07_02.slp (26.4 KB)3.4KViews0likes1CommentMongoDB Update Query Expression
I have a child pipeline, which contains a MongoDB Update Snap, and I am trying to have the Update Query be an expression so I can take into account parameters passed down to the child pipeline. The documents in the MongoDB Collection I am targeting, have a unique index on a field named “runId”, and so I am trying to match on this, and where found update another value in the document “documentsExpected”, again from another parameter. Below is what I tried as my expression, but it is choking. Is what I am attempting possible? If so, where am I going wrong with the expression? “{ _runId:” + _parentRunId + “}, { $set: { documentsExpected:” + _documentCount + " } }"5.5KViews0likes8Comments