Forum Discussion

pcoleman's avatar
pcoleman
New Contributor III
2 years ago
Solved

OAuth2 Return Values to transform data

Hi...We have a problem with OAuth2 authorization to Raiser's Edge. I can use the Account and get a token back...The problem is that their API expects us to pass that token in the HTTP Headers as a B...
  • del's avatar
    4 years ago

    @Charles,
    Like Patrick, I was also thinking Velocity (VTL) as a solution, but as I tried to solution your original post, the Workday namespace convention in the property names adds some complexity. I don’t know if Velocity beats the null-safe mapper for your particular use case, but it can be good info for your tool belt in the future.

    The kind of ugly solution I came up with (in a one-liner) is:

    [
        {
           "output" : #set ($pd = $['wd:Project_Data']) #set ($ed = $pd['wd:End_Date']) #if (${ed}) ${ed} #else null #end
        }
    ]
    

    I’m not well versed in VTL, so there’s likely something a little cleaner than the above.