Can we have a Auto Increment Field in -List custom fields ??

Hi Team,
It's really better if you provide Auto-Increment Field in List Custom Fields, I will tell you the purpose of this below:

Let's say When I upload a list whose field header values are Name & Email then it automatically add Auto-increment field S.No. for each list record, i.e An example I have shown below for my data example and what I want:

S.No. (Auto-Increment Field Which automatically issues serial number to each record of the list)NameEmail
1Name1name1@email.com
2Name2name2@email.com
3Name3name3@email.com
4Name4name4@email.com
5Name5name5@email.com


The benefit of the Auto-increment field is in the Segment Section where I have to retrieve records based on the S.No. and want to send mail between the particular segment filters which I have shown below in example

Segment condition 1 : (Segment1)

S.No. is greater than 0 and less than 3, So this segment shows the segment data record row from S.No. 1 to S.No.2
--(So we can send mails to the record of s.no. 1 to s.no. 2 only using this segment1)



Segment condition 2 : (Segment2)

S.No. is greater than 2 and less than 6, So this segment shows the segment data record row from S.No. 3 to S.No.5
--(So we can send mails to the record of s.no. 3 to s.no. 5 only using this segment2)

Can we do that ??
 

Attachments

  • screencapture-app-alerts-11xi-in-apps-customer-lists-hd906mnjwt56a-fields-2021-05-15-17_04_28.png
    screencapture-app-alerts-11xi-in-apps-customer-lists-hd906mnjwt56a-fields-2021-05-15-17_04_28.png
    157.8 KB · Views: 12
  • screencapture-app-alerts-11xi-in-apps-customer-lists-hd906mnjwt56a-segments-create-2021-05-15-...png
    screencapture-app-alerts-11xi-in-apps-customer-lists-hd906mnjwt56a-segments-create-2021-05-15-...png
    78 KB · Views: 12
Every subscriber added to Mailwizz has a unqiue SUBSCRIBER_ID/UID assigned at database level and auto increments as per standard.

This doesn't help you... but right now UID/ID/DATE_ADDED/LAST_UPDATED etc is not addressable via segmentation on Mailwizz. However FNAME, LNAME, EMAIL and literally any other custom field is available for segmentation.

In this case you could easily add a "S.NO" column to your CSV piror to uploading to Mailwizz (or API/FORM POST), this would automatically generate the new "custom field" and will be addressable on segmentation as you desire.

For example:

Field: "S.NO"
Operator: "Greater Than / Less Than"
Value: "XXXXX"

----------

If you are a developer, mostly likely you could do the following:

-- Add "S.NO" as a custom field to your list.
-- Edit the Import console/controller PHP to populate "S.NO" with SUBSCRIBER_ID. MW is based on Yii so will be $subscriber->subscriber_id;
 
The file import ONLY command/cron is located here:

/YOURWEBSITEDIRECTORY/apps/console/commands/ListImportCommand.php
(NOT Webform/API)


Line: 954-970 - addresses the headers/fields by TAGNAME for each subscriber/line.

foreach ($fields as $detail) {
if (!isset($tagToModel[$detail['tagName']])) {
continue;
}
$fieldModel = $tagToModel[$detail['tagName']];
$valueModel = ListFieldValue::model()->findByAttributes(array(
'field_id' => $fieldModel->field_id,
'subscriber_id' => $subscriber->subscriber_id,
));
if (empty($valueModel)) {
$valueModel = new ListFieldValue();
$valueModel->field_id = $fieldModel->field_id;
$valueModel->subscriber_id = $subscriber->subscriber_id;
}
$valueModel->value = $detail['tagValue'];
$valueModel->save();
}
 
Last edited:
Back
Top