By Andy on Friday, 17 November 2017
Posted in General Issues
Likes 0
Views 536
Votes 0
In EasySocial's points history database table there is a 'points_id' column.

Can you tell me how those points_id numbers can allocated when points are uploaded via CSV file, or created by points rule?

Why I'm asking is I'm trying to work out if I can use EasySocial points system for a project - but I need to be able to report on a certain type of points - this points_id might be what I need.

Thanks!
Hey Andy,
How does the system use and generate a points_id? Is it a direct link to a points rule.
Yes that is correct(http://take.ms/OVZTF).
Could I do a simple SQL to assign known UserIDs a number of points and make up a points_id that ES wouldn't be generating itself (for example alpha characters if that field allows) - so could I assign UserID 100 and UserID 150 a number of points and use the same points_id of ABTEST for example?
A query is possible however it may not be as simple as that since we have to consider achievements related to points.

The points_id only accepts integers and you can just use 0 for the points_id if you do not want the points earned to be associated with any existing rule.
·
Friday, 17 November 2017 12:27
·
0 Likes
·
0 Votes
·
0 Comments
·
Hi Andy,

The mass assignment feature does not rely on points_id or any points rule. It only assign points to the user.

As such, the points_id would be 0 in the points history table when users are mass assigned points.

It is not possible to integrate points_id into the mass assign feature currently.
·
Friday, 17 November 2017 11:17
·
0 Likes
·
0 Votes
·
0 Comments
·
Thanks Raymond... That's promising for what I have in mind. Two follow-on questions if you can help on these...

1) How does the system use and generate a points_id? Is it a direct link to a points rule. So 1 points_id number = 1 points rule?

2) Could I do a simple SQL to assign known UserIDs a number of points and make up a points_id that ES wouldn't be generating itself (for example alpha characters if that field allows) - so could I assign UserID 100 and UserID 150 a number of points and use the same points_id of ABTEST for example?

What I'm actually trying to do is find a way I can start allocating points by SQL but with some kind of common category code so that I can do other SQL statements to report on points allocated by these categories. I'm wondering if I can use 'points_id' field to do this.
·
Friday, 17 November 2017 11:52
·
0 Likes
·
0 Votes
·
0 Comments
·
OK that's wonderful. Thanks for all the help. I now understand and I can achieve what I want with this.

I need a few 'safe' numbers to use for my points_id but realise I can create 'dummy' points rules hopefully with criteria that would never trigger automatically (I will have to work something that works - I'll check ES points rule creation documentation) and then use their points_id numbers.

This will work because I'll be assigning by SQL rather than CSV upload actually.

Awesome.
·
Friday, 17 November 2017 19:31
·
0 Likes
·
0 Votes
·
0 Comments
·
Sorry just need one further bit of guidance... I'm looking at https://stackideas.com/docs/easysocial/developers/points/rule-file

Can you give me an example of a points file which wouldn't actually get triggered - it's just what to put on that 'application' line, 'extension' line, and 'state' line I think I need to understand....

Below is what I'm trying.. so (a) what goes in the command line? (b) is it safe to leave extension as "com_easysocial" and (c) state - is that just whether the points rule is active or not?

[
{
"title" : "PointsBySQL",
"alias" : "points-sql-rule1",
"description" : "Here are some points",
"command" : " ? what do I put here ?",
"extension" : "com_easysocial",
"state" : true,
"points" : 0
}
]
·
Friday, 17 November 2017 19:49
·
0 Likes
·
0 Votes
·
0 Comments
·
Hey Andy,

You can leave the extension as 'com_easysocial' and state as true. The state is just whether the points rule is published and active.

The command line is actually for developers to use in their function when they want to trigger the points from there.

Since you are only assigning points for your point rule via database manipulation, you can put anything in the command line.
·
Monday, 20 November 2017 14:06
·
0 Likes
·
0 Votes
·
0 Comments
·
Brilliant. Thanks for confirming!
·
Tuesday, 21 November 2017 00:12
·
0 Likes
·
0 Votes
·
0 Comments
·
You're most welcome Andy.

Regards.
·
Tuesday, 21 November 2017 10:08
·
0 Likes
·
0 Votes
·
0 Comments
·
View Full Post