Mule4 - Dataweave - use of read, fromBase64, valuesOf

 Scenario: Assuming that there is base64 encoded string containing values separated by tab(\t) and each row is separated by new line(\n) without any headers, how to extract and build json with predefined index mapped to particular attribute name.

Lets assume 0 index is firstName, 1st Index is lastName 2nd Index is customerId.

Sample Data:  

Mule\tSoft\taa234ed23e

Lets encode the above data to base64:

TXVsZVx0U29mdFx0YWEyMzRlZDIzZQ==

Now using dataweave functions read, fromBase64 and valueOf ,  extract and build json.






Comments

Popular posts from this blog

Mulesoft Certified Developer-Level2 - Study Material

Mule4- Salesforce Connector- Version-10.4.2 - Create job bulk api v 2 - ClientInputError:LineEnding is invalid on user data. Current LineEnding setting is LF

Salesforce Certified MuleSoft Platform Architect - Level1 - Reference Notes