# Callback (contact_set)

Create/Edit/Assign contacts collection

# Description

Contact_set callback is powerful tool to manage contacts from processing environment. The callback can create, edit or assign contacts to process contact collection.

# Creating contact

To create new contact search option must remain empty and data option must be filled. One new contact will be created from data that is provided.

# Editing contacts

To edit a group of contacts both search and data option must be filled. Filtered contacts by search criteria will be edited with data provided.

# Assigning contacts

To assign contacts to a collection collection option must be filled together with search or data option.

List of all available actions with corresponding config options filled:

Actions Config options required
assign collection, search
create data
edit data, search
create, assign data, collection
edit, assign data, search, collection

# Config

contact_set:

	config:

		# Contact collection
		collection:

			# Required | Type: string | Default: null
			# Collection name
			name: "suppliers"

			# Optional | Type: string | Default: override
			# Assignment modes add or override
			mode: "add"

		# Search criteria to find contacts for editing or assigning
		search:

			# Optional | Type: array | Default: null
			# Search by contact ids
			ids: [1,2,3]

			# Optional | Type: string | Default: null
			# Search in all contact fields
			all: "Joe Doe"

		# Data to update contacts
		data:

			# Optional | Type: string | Default: null
			# Category key
			category: "general"

			# Person and company data
			#
			### Note
			### Filled (value or null) properties in personal object will update contacts. Omitted properties will be ignored.
			personal:

				# Optional | Type: string | Default: null
				# First name
				name: "Joe"

				# Optional | Type: string | Default: null
				# Surname
				surname: "Doe"

				# Optional | Type: string | Default: null
				# Titles before name
				titlesBeforeName: "Bc."

				# Optional | Type: string | Default: null
				# Titles after name
				titlesAfterName: "Ph.D"

				# Optional | Type: string | Default: null
				# Salutation
				salutation: "Joe"

				# Optional | Type: string | Default: null
				# Nickname
				nickname: "Joe"

				# Optional | Type: string | Default: null
				# Birthday
				#
				### Note
				### Any parsable datetime string
				birthday: "25.6.1982"

				# Optional | Type: string | Default: null
				# Name day
				nameDay: "26.5"

				# Optional | Type: string | Default: null
				# Chat url
				chatUrl: "https://www.example.com"

				# Optional | Type: string | Default: null
				# Web url
				webUrl: "https://www.example.com"

				# Optional | Type: string | Default: null
				# Company name
				company: "Company s.r.o."

				# Optional | Type: string | Default: null
				# Company identification number
				in: 28205812

				# Optional | Type: string | Default: null
				# Company tax identification number
				tin: "CZ28205812"

				# Optional | Type: string | Default: null
				# Company incorporation details
				incorporation: "B 13098 vedená u Městského soudu v Praze"

				# Optional | Type: string | Default: null
				# Job
				job: "CEO"

			# Emails
			emails:

				# Optional | Type: string | Default: add
				# Insert mode add or override emails
				mode: "override"

				# Emails
				data:

					# Index (name1, name2, ...., nameN)
					[name]:

						# Required | Type: string | Default: null
						# Email address
						email: "joe.doe@example.com"

						# Required | Type: string | Default: null
						# Email type key
						type: "work"

						# Optional | Type: string | Default: null
						# Note
						note: "This email needs to be verified"

			# Phones
			phones:

				# Optional | Type: string | Default: add
				# Insert mode add or override phones
				mode: "override"

				# Phones
				data:

					# Index (name1, name2, ...., nameN)
					[name]:

						# Required | Type: string | Default: null
						# Phone number
						number: "+420777555666"

						# Required | Type: string | Default: null
						# Phone type
						type: "home"

						# Optional | Type: string | Default: null
						# Note
						note: "This number has been disconnected"

			# Addresses
			addresses:

				# Optional | Type: string | Default: add
				# Insert mode add or override addresses
				mode: "override"

				# Addresses
				data:

					# Index (name1, name2, ...., nameN)
					[name]:

						# Required | Type: string | Default: null
						# Address type key
						type: "shipping"

						# Optional | Type: string | Default: null
						# Street
						street: "Main road"

						# Optional | Type: string | Default: null
						# House number
						houseNumber: 55

						# Optional | Type: string | Default: null
						# Zip code
						zipCode: "544 00"

						# Optional | Type: string | Default: null
						# City
						city: "Westminster"

						# Optional | Type: string | Default: null
						# PO Box
						poBox: "P.O. Box 123"

						# Optional | Type: string | Default: null
						# Note
						note: "Goods were not delivered to this address"

			# Notes
			notes:

				# Optional | Type: string | Default: add
				# Insert mode add or override notes
				mode: "override"

				# Notes
				data:

					# Index (name1, name2, ...., nameN)
					[name]:

						# Required | Type: string | Default: null
						# Note
						note: "Joe Doe has been contacted"

			# Tags
			tags:

				# Optional | Type: string | Default: add
				# Insert mode add or override tags
				mode: "override"

				# Optional | Type: array | Default: []
				# Tag keys
				data: [vip, blue]
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220