I often use badges to create a layer of page authentication.
I would greatly benefit from a feature that would allow badge REMOVAL as an automation when a specific form submission is completed.
I often use badges to create a layer of page authentication.
I would greatly benefit from a feature that would allow badge REMOVAL as an automation when a specific form submission is completed.
Hi,
Absolutely! I would also love to see that feature in the Automation. My vote is in too!
Rick, I wanted to make you aware that it can be accomplished through coding in a few steps.
Protect your form page with members-only permission in the page settings. (optional)
Add a After Insert data hook to the form collection:
https://www.wix.com/velo/reference/wix-data/hooks/afterinsert
import { badges } from 'wix-members-backend';
export function contact11_afterInsert(item, context) {
await badges.removeMembers("badgeID", [context.userId])
return item
}
If you don’t wish for the page to be accessible only to logged-in members, and to remove the badge only if a site member submits the form, then you can do so
import { badges } from 'wix-members-backend';
export function contact11_afterInsert(item, context) {
if(context.userRole === "siteMember"){
await badges.removeMembers("badgeID", [context.userId])
return item
}
return item
}
Note: *Replace “badgeID”
Thanks. This solution does not apply to my need.
This seems like it would be easy for the Wix developers to add, but I am guessing by the lack of response in 3 months, that this whole feature request forum is not monitored.