Expensify.org is accepting proposals for new campaigns. Submit yours here by May 15th to receive up to $100,000 in funding for campaigns dismantling injustice related to: Climate Justice, Food Security, Housing Equity, Reentry Services, and Youth Advocacy.

Substring usage on Credit Card report name not working

TIQPat
TIQPat Expensify Customer Posts: 2 Expensify Newcomer

Hello,

My credit card reports are autogenerated and updated and working beautifully. However, the default name of the report is something like this:
XXXX-XXXX-XXXX-9999 Credit Card for My Employee...

I want to skip the xxxx- part, so I created this template:
{report:card|substring:0:15} Credit Card for My Employee... hoping to see
9999 Credit Card for My Employee...
but I get this:
{report:card|substring:0:15} Credit Card for ... The Substring is not interpreted.

What am I doing wrong?
Thanks in advance.

Best Answer

  • Karisa Latta
    Karisa Latta Expensify Success Coach - Admin, Expensify Team Posts: 144 Expensify Team
    Accepted Answer

    Hey TIQPat!

    With substrings, the first integer is actually the start position. Using 0 as the first integer tells the system to start reading at the beginning. You'll want to set the first integer to 15 in your case. The second integer is how many characters after the first integer to keep reading through. This can be 25 to ensure you're capturing as many characters as possible.

    Please try:
    {report:card|substr:15:25}

    The | icon is the straight line above your enter key (usually hangs out with \ on the same key).

    We have a complete custom formula guide here!

Answers

Sign In or Register to comment.