circle - adors auto increment

123 views
Skip to first unread message

Yannick François

unread,
Jul 2, 2021, 9:54:10 AM7/2/21
to XMPie Interest Group
Hi,

How I can do to have an ador with auto increment value after new registration ?

I tried with a variable to get each user (select count(*) or select max(id)), after I set the id with this variable.
The problem is: the first registration doesn't works, the second yes but the id from de first user has been updated after the second registration. Weird!

thanks for help

west-digital.fr

unread,
Jul 2, 2021, 10:04:59 AM7/2/21
to XMPie Interest Group
Hello,

What do you exactly mean with "the first registration doesn't work"?

You could consider an alternative option (more complex, for sure, but as you are facing weird behaviors with simple options, maybe it's worth it):
  • define a User View with "SELECT id FROM @[your table]" without any "WHERE" clause
  • define an ADOR with RowCount(your User View name) + 1

Yannick François

unread,
Jul 2, 2021, 10:09:14 AM7/2/21
to XMPie Interest Group
What do you exactly mean with "the first registration doesn't work"?
=> the user is correctly added and he's redirected to the second page but I've this error message "recipient id not found". If I download the data source, the new user is here but without xmpieRecipientKey

Thanks for the tips,I'll try then I'll tell you if it's works

west-digital.fr

unread,
Jul 2, 2021, 10:22:36 AM7/2/21
to XMPie Interest Group
OK.

At first, I didn't understand that your use case was related to the XMPieRecipientKey.
I suppose that you're working on a fictitious, demo campaign; because GDPR would certainly forbid you to generate such simple RIDs in real-life campaigns.
That's why customers usually let Circle / uProduce generate randomized RIDs instead, with the |->[?] := SecureID() QLingo in the Insert expression.

Yannick François

unread,
Jul 2, 2021, 10:31:48 AM7/2/21
to XMPie Interest Group
Je vais essayer en français, il semblerait que vous le soyez aussi vu le lien vers west-digital.

Cet ador, id, est juste là pour attribuer à la personne qui s'enregistre son positionnement dans la base de donnée. Le XMPieRecipientKey est ajouté par Circle est reste bel et bien l'identifiant unique pour mes utilisateurs.

Si j'ai un utilisateur avec l'id 1, le suivant sera le 2, etc..  Je me sers de cette id pour tout autre chose

Yannick François

unread,
Jul 2, 2021, 12:31:32 PM7/2/21
to XMPie Interest Group
@west-digital.fr : I'll try useView with rowCount as you mentioned above but when a new user do a registration, every IDs are incremented. On the second page (ng-controller="XMPPersonalizedPage), I added this snippet :
<xmp-update-on-page-load xmp-ador="xmp.r.idxmp-value="{{xmp.r.id}}"/>

any ideas ?

west-digital.fr

unread,
Jul 5, 2021, 9:25:33 AM7/5/21
to XMPie Interest Group
Could you confirm that the following fits with what you want to achieve?


Wayne Butcher

unread,
Jul 5, 2021, 5:33:13 PM7/5/21
to xmpie...@googlegroups.com
You may want to consider concurrency, these types of approaches will fail if multiple users are accessing the site at the same time.
Normally these types of operations should be done server side not client side.
If you have access to the XMPDBHDS then it's pretty easy otherwise you need to use uPlan.

Regards,
Wayne

--
You received this message because you are subscribed to the Google Groups "XMPie Interest Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to xmpie-users...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/xmpie-users/19d22b51-2a3b-4af6-8c8f-b900f7dbda41n%40googlegroups.com.

Yannick François

unread,
Jul 6, 2021, 5:47:53 AM7/6/21
to XMPie Interest Group
@west-digital : yes that's it ! Actually it's working for me since yesterday. I had user view with this query :

select @[data].[id] from @[data]

In Ador Objects, I edited my ador "id" with this read expression !

if (AsNumber(|->[id]) > 0)
{
|->[id]
}
else
{
RowCount([count])
}

and this for write expression : |->[id] := AsNumber(value)

I don't know if it's a good practice but as I'm saying, it's works. How do you do this simple page ? Same way ?

@Wayne : yes of course I did it with uPlan as you can read above. Are you agree ?

west-digital.fr

unread,
Jul 7, 2021, 2:58:38 AM7/7/21
to XMPie Interest Group
Please find our plan attached, which is, as you did yourself, the sole, server-side, generator of the increment.
is54test.plan

Wayne Butcher

unread,
Jul 7, 2021, 5:04:26 PM7/7/21
to xmpie...@googlegroups.com
Looks good to me.
My comment was more for west-digital-fr was just trying to help
Regards
Wayne

Reply all
Reply to author
Forward
0 new messages