You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: src/unified-profiles/create-sql-traits.md
+14-14Lines changed: 14 additions & 14 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,8 +1,8 @@
1
1
---
2
-
title: RETL Scripts For Importing Salesforce Objects Into Unified Profiles
2
+
title: RETL Scripts For Importing Salesforce Objects Into Unified Profiles in Flex
3
3
hidden: true
4
4
---
5
-
Unified Profiles users can convert Salesforce objects with US phone number patterns (typically (555) 231-7654) into Segment Unify profiles with E.164 phone number formats (+15552317654) to support Unified Profiles lookup.
5
+
Unified Profiles in Flex users can convert Salesforce objects with US phone number patterns (typically (555) 231-7654) into Segment Unify profiles with E.164 phone number formats (+15552317654) to support Unified Profiles lookup.
6
6
7
7
Segment created three sample queries for Unified Profiles users to import common Salesforce objects:
8
8
-[Accounts](#accounts)
@@ -16,9 +16,11 @@ To selectively import columns, replace the `a*`, `c*`, or `l*` with a list of fi
16
16
17
17
## Accounts
18
18
19
-
To import Salesforce Accounts into Unified Profiles as Segment Unify profiles, create a RETL mapping with the following format.
19
+
To import Salesforce Accounts into Unified Profiles as Segment Unify profiles, create a RETL mapping with the following format.
20
20
21
-
Replace `<database_name.account_table>` with your database name and account table, `PHONE` with the name of the column in your warehouse that contains phone numbers, and `BILLING_COUNTRY` with the name of the column in your warehouse that contains the account's country.
21
+
Replace `<database_name.account_table>` with your database name and account table, `PHONE` with the name of the column in your warehouse that contains phone numbers, and `BILLING_COUNTRY` with the name of the column in your warehouse that contains the account's country. In this example query, the `PHONE` column is the primary contact phone number and what you import as the Profile’s 'phone' trait.
22
+
23
+
The other phone fields for Salesforce Accounts are PersonHomePhone, PersonMobilePhone, & PersonOtherPhone, and could be substituted for `PHONE` in this query. **You can only import one phone number field as the identifier used for lookups in Flex.**
22
24
23
25
```sql
24
26
SELECT
@@ -37,16 +39,16 @@ WHERE
37
39
ANDa.BILLING_COUNTRYIS NOT NULL;
38
40
```
39
41
40
-
Salesforce objects have several phone number-related fields. In this example query, the “PHONE” column is the primary contact phone number and what you import as the Profile’s 'phone' trait. The other phone fields for Salesforce Accounts are PersonHomePhone, PersonMobilePhone, & PersonOtherPhone, and could be substituted for "PHONE" in this query.
41
-
42
-
After running this query, ‘phone’ can be used as an identifier used for lookups in Unified Profiles.
42
+
After running this query, you can use ‘phone’ for lookups in Unified Profiles.
43
43
44
44
45
45
## Contacts
46
46
47
47
To import Salesforce Contacts into Unified Profiles as Segment Unify profiles, create a RETL mapping with the following format.
48
48
49
-
Replace `<database_name.contact_table>` with your database name and account table, `PHONE` with the name of the column in your warehouse that contains phone numbers, and `BILLING_COUNTRY` with the name of the column in your warehouse that contains the contact's country.
49
+
Replace `<database_name.contact_table>` with your database name and account table, `PHONE` with the name of the column in your warehouse that contains phone numbers, and `BILLING_COUNTRY` with the name of the column in your warehouse that contains the contact's country.
50
+
51
+
Salesforce objects have several phone number-related fields. In this example query, the `PHONE` column is the primary contact phone number and what you import as the Profile’s 'phone' trait. The other phone fields for Salesforce Contacts are HomePhone, MobilePhone, & OtherPhone, and could be substituted for `PHONE` in this query. **You can only import one phone number field as the identifier used for lookups in Flex.**
50
52
51
53
```sql
52
54
SELECT
@@ -65,16 +67,16 @@ WHERE
65
67
ANDc.BILLING_COUNTRYIS NOT NULL;
66
68
```
67
69
68
-
Salesforce objects have several phone number-related fields. In this example query, the “PHONE” column is the primary contact phone number and what you import as the Profile’s 'phone' trait. The other phone fields for Salesforce Contacts are HomePhone, MobilePhone, & OtherPhone, and could be substituted for "PHONE" in this query.
69
-
70
-
After running this query, ‘phone’ can be used as an identifier used for lookups in Unified Profiles.
70
+
After running this query, you can use ‘phone’ for lookups in Unified Profiles.
71
71
72
72
## Leads
73
73
74
74
To import Salesforce Leads into Unified Profiles as Segment Unify profiles, create a RETL mapping with the following format.
75
75
76
76
Replace `<database_name.lead_table>` with your database name and lead table, `PHONE` with the name of the column in your warehouse that contains phone numbers, and `BILLING_COUNTRY` with the name of the column in your warehouse that contains the lead's country.
77
77
78
+
Salesforce objects have several phone number-related fields. In this example query, the `PHONE` column is the primary contact phone number and what you import as the Profile’s 'phone' trait. The other phone fields for Salesforce Leads are HomePhone, MobilePhone, & OtherPhone, and could be substituted for `PHONE` in this query. **You can only import one phone number field as the identifier used for lookups in Flex.**
79
+
78
80
```sql
79
81
SELECT
80
82
l.*,
@@ -92,9 +94,7 @@ WHERE
92
94
ANDl.BILLING_COUNTRYIS NOT NULL;
93
95
```
94
96
95
-
Salesforce objects have several phone number-related fields. In this example query, the “PHONE” column is the primary contact phone number and what you import as the Profile’s 'phone' trait. The other phone fields for Salesforce Leads are HomePhone, MobilePhone, & OtherPhone, and could be substituted for "PHONE" in this query.
96
-
97
-
After running this query, ‘phone’ can be used as an identifier used for lookups in Unified Profiles.
97
+
After running this query, you can use ‘phone’ for lookups in Unified Profiles.
98
98
99
99
## Troubleshooting
100
100
If these queries don't return phone numbers in E.164 format, examine your existing data and change the REGEX patterns as appropriate.
0 commit comments