I have a webhook that is receiving a date value response in either "m/d/yy" or "yyyy-mm-dd" format and keeps converting it to be today's date.
For example, the webhook received responses such as "2/1/20" and "2020-02-01" but keeps setting the field to 2020-02-06.
Any ideas?
It is actually some additions to that code you helped me with awhile ago. I updated it to retrieve a second column's values at the same time.
Here's an example, where it receives "lastActivity":"2020-02-01" but sets to today's date.
Choice Number: | 1711 |
Pay Load: | var services = { owners : { serviceURL : "http://na-ab39.marketo.com/rs/[redacted]/images/contactOwners-v2.csv", interestingHeaders : { email : "Email", contactOwner : "Contact Owner", lastActivity : "Last Activity" }, mktoFields : { outputOwner : "leadOwnerFullName", outputLastActivity : "lastActivity", noMatch : "NeedsAttention" } } }; /* --- NO NEED TO EDIT BELOW THIS LINE --- */ var service = services.owners; var leadEmail = "test@testing.com".toLowerCase(); FBHttp .fetch( service.serviceURL ) .then( response => response.text() ) .then( textResp => { var textNoBOM = textResp.charCodeAt(0) === 0xFEFF ? textResp.slice(1) : textResp, rows = FBText.CSV.parse(textNoBOM); return { headers: rows.shift(), data: rows }; }) /* .then( source => { return { headers: source.headers, data: source.data.map( row => row.map( col => col.trim() ) ) } }) */ .then( sourceMatchable => { var resp = {}, emailHeaderIdx = sourceMatchable.headers.indexOf(service.interestingHeaders.email), contactOwnerHeaderIdx = sourceMatchable.headers.indexOf(service.interestingHeaders.contactOwner), lastActivityHeaderIdx = sourceMatchable.headers.indexOf(service.interestingHeaders.lastActivity), match = sourceMatchable.data.find( tup => leadEmail == tup[emailHeaderIdx] ); if (match) { resp[service.mktoFields.outputOwner] = match[contactOwnerHeaderIdx]; resp[service.mktoFields.outputLastActivity] = match[lastActivityHeaderIdx]; resp[service.mktoFields.noMatch] = false; } else { resp[service.mktoFields.noMatch] = true; } return resp; }) .then( success ) .catch( failure ) |
Url: | |
Webhook Id: | 15 |
Webhook Name: | Lookup Lead Owner v3 |
Request Type: | http_post |
Step ID: | 478 |
Source: | Marketo Flow Action |
Response: | {"response":{"leadOwnerFullName":"Testing Test","lastActivity":"2020-02-01","NeedsAttention":false}} |
Person ID: | 1024192 |
Response Code: | 200 |
Oh, a FLOWBOOST webhook. Now you've got my attention. 🙂
I'll check it out later, though, as I'm on the road.
Can't repro this. Are you positive, Travis, that the value is being set by the Call Webhook ("Reason: Webhook Updated Person")?