Parse text and look up ID based on result

Parse text and look up ID based on result

This script parses out the first Lead Source from a comma or semi-colon separated list and then gets the Lead Source ID from an xRef list.

Function ScriptedField
 Dim ls
 Dim res
 ls = "@@ORG:CUSTOM07@@"
 If Len(ls) <> 2 Then
  If InStr(ls,",") > 0 Then
   ls = Left(ls,InStr(ls,",")-1)
  End If
  If InStr(ls,";") > 0 Then
   ls = Left(ls,InStr(ls,";")-1)
  End If
  res = ls
 Else
  res = XrefRead("sf-LeadSource",ls)
 End If
 ScriptedField=res
End Function
    • Related Articles

    • Look in many xref lists for an origin ID

      Function ScriptedField Dim newid Dim oldid oldid = "@@ORG:OLDID@@" newid = XrefRead("Accounts",oldid) If Len(newid) = 0 Then newid = XrefRead("Contacts",oldid) End If If Len(newid) = 0 Then newid = XrefRead("Opportunities",oldid) End If If Len(newid) ...
    • Validate and parse JSON

      This is a link to a page that will validate/parse your JSON: http://jsonlint.com/
    • Exp Detect URLs in text with JavaScript

      A tool that can detect URLs in text with JavaScript can be found here: https://www.regextester.com/96249%7CRegular
    • Parse XML

      First I add code and External Assemblies to the .NET GLobal section of the Mapping tab: using System; using System.Collections.Generic; using System.Xml; XmlDocument demographicsXML = new XmlDocument(); XmlNodeList nodes; External Assemblies: ...
    • Salesforce Connector

      Additional Documentation This Connector is based on the Salesforce ADO.NET Provider by CData. For additional help, including Connection String parameters, please see: https://cdn.cdata.com/help/RFG/ado/ Salesforce Origin Case as Origin Table You ...