Page 1 of 1

assign records to groups on import

Posted: 2017-03-01 10:06
by bescott53
Is there a way to assign records I am importing on a schedule in mysql to groups based on the value in a column in the data I am importing?

Re: assign records to groups on import

Posted: 2017-03-09 10:59
by bescott53
Any ideas on this board?

Re: assign records to groups on import

Posted: 2017-03-09 20:01
by AhmedBR
I use the following in ini hook:

In my case I use a field called Group where I assign the Group Number and that number is used to assig the user records automatically
Anytime the Group is changed it is assigned to the new group.


sql("UPDATE membership_userrecords
left join Delivery
on YOURTABLE.ID = membership_userrecords.pkValue
set membership_userrecords.groupID = YOURTABLE.Group
where membership_userrecords.tableName = 'YOURTABLE' ",$eo);

You can go from here.

Re: assign records to groups on import

Posted: 2017-03-14 10:40
by bescott53
thanks AhmedBR, I am looking for a file called ini hook, but I don't have it? Do you know where this would go?

Re: assign records to groups on import

Posted: 2017-03-14 18:38
by AhmedBR
it is init (not ini, the t must have fallen) hook is a function in EVERY file (each table has one) in the HOOK folder.

Take a look at this tutorial about using hooks:
https://bigprof.com/appgini/help/advanc ... ename_init