Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

a Helper function to decode _id #15428

Open
poirazis opened this issue Jan 23, 2025 · 1 comment
Open

a Helper function to decode _id #15428

poirazis opened this issue Jan 23, 2025 · 1 comment
Labels
enhancement New feature or request

Comments

@poirazis
Copy link
Contributor

When working with forms / relationship pickers with SQL db , the numeric ids get encoded.
Often we need to grab an id from a form or a picker to pass to a custom query or filter, and we need the unencoded id.
this is not hard to do, with JS, but it so redundant that would be easier to have a helper funtion.

it would look like {{ decodeId Form.Relationship.0_id }}

you can curretnly decode it using

if ( val && val.length )
  return val[0]._id.substring(3, val[0]._id.length - 3)
@poirazis poirazis added the enhancement New feature or request label Jan 23, 2025
Copy link

linear bot commented Jan 23, 2025

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant