Skip to Content Skip to Menu

How to shorten [va3_message] to only 50 characters?

  • timstohr
  • timstohr
  • OFFLINE
  • Posts: 1091
  • Thanks: 56
  • Karma: 9
2 years 11 months ago - 2 years 11 months ago #327421 by timstohr
Hi Kyle, I would need to shorten the variable [var3_message] to a maximum of 50 characters. If it shortens it, then it should append ... to the shortened message.
I am using [var3_message] in an Auto action in a notification and it looks quite bad if a user copies a whole book passage into an activity.

Kind regards,

Tim
Last edit: 2 years 11 months ago by timstohr.

Please Log in or Create an account to join the conversation.

  • krileon
  • krileon
  • ONLINE
  • Posts: 48541
  • Thanks: 8290
  • Karma: 1445
2 years 11 months ago #327432 by krileon
You shouldn't need to be storing the activity message with the notification. CB Activity can handle parsing activity asset notifications. Simply create a notification with an asset of "activity.ACTIVITY_ID" and it will handle parsing out the message, shortening it, and linking to the activity entry automatically.


Kyle (Krileon)
Community Builder Team Member
Before posting on forums: Read FAQ thoroughly + Read our Documentation + Search the forums
CB links: Documentation - Localization - CB Quickstart - CB Paid Subscriptions - Add-Ons - Forge
--
If you are a Professional, Developer, or CB Paid Subscriptions subscriber and have a support issue please always post in your respective support forums for best results!
--
If I've missed your support post with a delay of 3 days or greater and are a Professional, Developer, or CBSubs subscriber please send me a private message with your thread and will reply when possible!
--
Please note I am available Monday - Friday from 8:00 AM CST to 4:00 PM CST. I am away on weekends (Saturday and Sunday) and if I've missed your post on or before a weekend after business hours please wait for the next following business day (Monday) and will get to your issue as soon as possible, thank you.
--
My role here is to provide guidance and assistance. I cannot provide custom code for each custom requirement. Please do not inquire me about custom development.

Please Log in or Create an account to join the conversation.

  • timstohr
  • timstohr
  • OFFLINE
  • Posts: 1091
  • Thanks: 56
  • Karma: 9
2 years 11 months ago #327443 by timstohr
Hi, in general I would agree with you and if it was a normal notification I would use the setup you described but it does not work for my pusher. I would need [var3_message] for that.

Please Log in or Create an account to join the conversation.

  • krileon
  • krileon
  • ONLINE
  • Posts: 48541
  • Thanks: 8290
  • Karma: 1445
2 years 11 months ago #327445 by krileon
For your pusher? Can you be more specific? I don't have a solution for you in regards to reducing the length of the notification. There isn't a message shortener based off length for notifications.


Kyle (Krileon)
Community Builder Team Member
Before posting on forums: Read FAQ thoroughly + Read our Documentation + Search the forums
CB links: Documentation - Localization - CB Quickstart - CB Paid Subscriptions - Add-Ons - Forge
--
If you are a Professional, Developer, or CB Paid Subscriptions subscriber and have a support issue please always post in your respective support forums for best results!
--
If I've missed your support post with a delay of 3 days or greater and are a Professional, Developer, or CBSubs subscriber please send me a private message with your thread and will reply when possible!
--
Please note I am available Monday - Friday from 8:00 AM CST to 4:00 PM CST. I am away on weekends (Saturday and Sunday) and if I've missed your post on or before a weekend after business hours please wait for the next following business day (Monday) and will get to your issue as soon as possible, thank you.
--
My role here is to provide guidance and assistance. I cannot provide custom code for each custom requirement. Please do not inquire me about custom development.

Please Log in or Create an account to join the conversation.

  • timstohr
  • timstohr
  • OFFLINE
  • Posts: 1091
  • Thanks: 56
  • Karma: 9
2 years 11 months ago #327446 by timstohr
I have a pusher which seems push notification to my app whenever something triggers an AA. I had hoped that it would be possible to shorten var3_message variable if it is longer than 50 characters. I could have used that shortener as well for making the internal notifications shorter as well. I am using the activity ID asset but the notification body is supposed to contain var3_message

Please Log in or Create an account to join the conversation.

  • krileon
  • krileon
  • ONLINE
  • Posts: 48541
  • Thanks: 8290
  • Karma: 1445
2 years 11 months ago #327463 by krileon
You might be able to use the format functions for that, but it's not going to add the ... for you. Ensure format functions are enabled under Parameters and use the following.

[cb:parse function="extract" length="50"][var3_message][/cb:parse]

Most notifications in CB Activity do not have a stored message though. Their message gets populated with data during their display handling.


Kyle (Krileon)
Community Builder Team Member
Before posting on forums: Read FAQ thoroughly + Read our Documentation + Search the forums
CB links: Documentation - Localization - CB Quickstart - CB Paid Subscriptions - Add-Ons - Forge
--
If you are a Professional, Developer, or CB Paid Subscriptions subscriber and have a support issue please always post in your respective support forums for best results!
--
If I've missed your support post with a delay of 3 days or greater and are a Professional, Developer, or CBSubs subscriber please send me a private message with your thread and will reply when possible!
--
Please note I am available Monday - Friday from 8:00 AM CST to 4:00 PM CST. I am away on weekends (Saturday and Sunday) and if I've missed your post on or before a weekend after business hours please wait for the next following business day (Monday) and will get to your issue as soon as possible, thank you.
--
My role here is to provide guidance and assistance. I cannot provide custom code for each custom requirement. Please do not inquire me about custom development.

Please Log in or Create an account to join the conversation.

Moderators: beatnantkrileon
Powered by Kunena Forum