Import of campaign participants

Hi community!

 

Our customer wants to import campaigns with participants of an old system to keep that data as history.

I managed to import the campaigns (see Can't import campaigns | Community Creatio), but I can't import the participants.

The import tells me that the field 'current step' is mandatory. Is there any way to work around this or a fixed value that I can use? My problem is that the old campaigns do not have a single step, because they just act like an empty container and the participation should be used as criteria for building marketing segments in the future.

 

Thanks and BR,

Robert

Like 0

Like

2 comments
Best reply

Hello Robert,

 

If possible, I would suggest filling the field of CampaignParticipant table

 

1) The following script will add one empty CampaignItem record (which is current step) for each campaign:

 

Insert into "CampaignItem" ("CampaignId") (select "Id" from "Campaign") 

 

2) Then you can set the name for all those records if you want:

update "CampaignItem" set "Name" = 'test' where "Name" = ''

 

3) The next script will set the CampaignItemId (if it is null) of the CampaignParticipant to any that is available in the corresponding campaign (There will always be at least one since in the first script we added one for each):



update "CampaignParticipant" set "CampaignItemId" = (select "Id" from "CampaignItem" where "CampaignItem"."CampaignId" = "CampaignParticipant"."CampaignId" limit 1) where "CampaignItemId" is null

 

That last script will only modify the participants who do not already have current step specified. 

 

If you know that there are campaign items for each campaign then you can skip the first and second scripts.

 

Hope it helps!

 

Best regards,

Max,

Hello Robert,

 

If possible, I would suggest filling the field of CampaignParticipant table

 

1) The following script will add one empty CampaignItem record (which is current step) for each campaign:

 

Insert into "CampaignItem" ("CampaignId") (select "Id" from "Campaign") 

 

2) Then you can set the name for all those records if you want:

update "CampaignItem" set "Name" = 'test' where "Name" = ''

 

3) The next script will set the CampaignItemId (if it is null) of the CampaignParticipant to any that is available in the corresponding campaign (There will always be at least one since in the first script we added one for each):



update "CampaignParticipant" set "CampaignItemId" = (select "Id" from "CampaignItem" where "CampaignItem"."CampaignId" = "CampaignParticipant"."CampaignId" limit 1) where "CampaignItemId" is null

 

That last script will only modify the participants who do not already have current step specified. 

 

If you know that there are campaign items for each campaign then you can skip the first and second scripts.

 

Hope it helps!

 

Best regards,

Max,

Max,

Hi Max,

 

thanks, that worked like a charm! I executed scripts 1 and 2 and then imported the participants with reference to the newly created step (I have deleted the participant table before to have a fresh start).

 

Many thanks and best regards,

Robert

Show all comments