SOLVED

Re: Change Data Value (to remove characters)

Go to solution
sg
Level 2
Level 2

Change Data Value (to remove characters)

Hi,

I have a custom field with JSON data as 

[{"Submitted":"2020-08-13 11:58","Title": "Emails from SJSU to LGSB","Program of Interest": "Early Career MBA","Referral": "LGSB Outreach, Web search","Intended Term": "Fall 2021","Subscribed to LGSB":true}]

 

In Change Data Value, I would like to remove the square braces '[' and ']'. How to do that?

like in a  javascript.  can I do that, if so how?

I do not want to download the entire data and re-upload making changes to that field. 

 

thanks

-Sree

1 ACCEPTED SOLUTION

Accepted Solutions
Darshil_Shah1
Level 10 - Community Advisor + Adobe Champion

Re: Change Data Value (to remove characters)

This is definitely possible via a webhook compatible service like Flowboost. Looking at the data it appears to be written to send information of multiple attributes coalesced in a single field in the form of a JSON array. You could have multiple array elements it in the future, where in you may not want to remove the [] so that remains a valid JSON array. Having said that, what’s your exact business case for removing the []? You can easily parse this data using velocity, filter people using contains in a smart list, flow conditions, etc. I don’t like the idea of converting a valid JSON to some non-standard format in the first place. 

Edit - Sandy and my messages just crossed, but glad we both have similar thoughts on knowing the business case first.

View solution in original post

3 REPLIES 3
Beth_Massura
Level 8 - Champion Alumni

Re: Change Data Value (to remove characters)

Hi Sree,

 

Unfortunately, Change Data Value flow steps do not offer that kind of manipulation directly. Your options with Change Data Value flow steps are to set a specific value, set the value from a token or NULL the value.

 

You may be able to use a webhook or Launchpoint integration to an outside system (such as an iPaaS solution) to conduct that kind of data manipulation.

 

Was this a one-time data import? If it is ongoing, would it be possible to have the data stripped of the brackets before it is sent to Marketo going forward?

 

How are you using the data in the custom field in Marketo? Based on your example it looks like it might be a candidate for a custom activity in Marketo, which would enable you to trigger and filter based on specific elements within it. For example, if the submission's program of interest is "Early Career MBA", you could target that person with early career MBA email content.

 

Cheers,

Beth Massura

2022 Adobe Marketo Engage Champion

SanfordWhiteman
Level 10 - Community Moderator

Re: Change Data Value (to remove characters)

Let’s step back and make sure we don’t have an XY Problem.

 

What exactly is your worry about those characters? That’s standard JSON, the brackets absolutely belong there. Stripping them out permanently means it’s some random non-standard format. That’s a bad idea.

 

Are you trying to display the data from that JSON field in an email or on an LP? If so there’s no reason to change anything. In Velocity (for emails) or JS (for LPs) you can easily parse that field into its individual sub-fields (the Submitted value, the Program Interest Value, etc.).

Darshil_Shah1
Level 10 - Community Advisor + Adobe Champion

Re: Change Data Value (to remove characters)

This is definitely possible via a webhook compatible service like Flowboost. Looking at the data it appears to be written to send information of multiple attributes coalesced in a single field in the form of a JSON array. You could have multiple array elements it in the future, where in you may not want to remove the [] so that remains a valid JSON array. Having said that, what’s your exact business case for removing the []? You can easily parse this data using velocity, filter people using contains in a smart list, flow conditions, etc. I don’t like the idea of converting a valid JSON to some non-standard format in the first place. 

Edit - Sandy and my messages just crossed, but glad we both have similar thoughts on knowing the business case first.