Skip to main content

Notifications

Community site session details

Community site session details

Session Id :
Power Automate - Using Flows
Answered

Format aa account code (general ledger code) for a CSV report - lookup value

(0) ShareShare
ReportReport
Posted on by 11

Hi All,

 

If someone could please assist me with this expression, it would be appreciated.

 

I am creating a CSV report from a sharepoint list.  On the SP list there are look up columns and one of the columns is an account code in the format of 4-7006.   On the sharepoint list the column is a text column.

 

I have gotten as far as this expression concat('4-7', formatNumber(float(split(item()?['Course_x003a__x0020_GL_x0020_Cod/Value'], '-')[sub(length(split(item()?['Course_x003a__x0020_GL_x0020_Cod/Value'], '-')), 1)]), '000'))

 

When I run the report it is inserting an additional number 7, that is 4-77006 instead of 4-7006.   I've tinkered with the expression but I can't figure out where I'm going wrong.

 

If anyone is able to assist me with this, it would be appreciated, thanks Liz 

 

  • lhowlett2022 Profile Picture
    11 on at
    Re: Format aa account code (general ledger code) for a CSV report - lookup value

    Hi @Expiscornovus 

     

    Thanks so much for your time looking at my issue.  😀 You did point me in the right direction, that is from the status of I didn't know there was a skip function  😐 to a now completed power automate.

     

    For a bit more context for those that maybe searching for a similar solution,  I have a list of transactions, that I am running a recurring report on a weekly basis to email as a CSV report.   The list of transactions, has many lookup columns, including the account code or general ledger code for the item.  They are different account codes for different products, the format is 4-7XXX, so the code could be 4-7010, 4-7025, 4-7050.

     

    In tne end the expression that worked for me:

    concat(split(item()?['your column name/value'], '-')[0], '-', slice(item()?['your column name/value '], add(indexOf(item()?['your column name/value'], '-'), 1)))

     

    many thanks Liz

     

    Cheers Liz

     

     

     

     

     

     

     

  • Verified answer
    Expiscornovus Profile Picture
    31,643 Most Valuable Professional on at
    Re: Format aa account code (general ledger code) for a CSV report - lookup value

    Hi @lhowlett2022,

     

    Afaik the zero placeholder is to add zeros to the number. It looks like you just want to collect the last three characters of the second part of your string? Can you also share some sample input, this will help testing/troubleshooting.

     

    If that is the case use a skip function instead (in this example I am only skipping 1 item, you might need to calculate how many you need to skip, based on the length of the string).

    concat('4-7', skip(split(item()?['Course_x003a__x0020_GL_x0020_Cod/Value'], '-')[sub(length(split(item()?['Course_x003a__x0020_GL_x0020_Cod/Value'], '-')), 1)], 1))

     

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

🌸 Community Spring Festival 2025 Challenge 🌸

WIN Power Platform Community Conference 2025 tickets!

Markus Franz – Community Spotlight

We are honored to recognize Markus Franz as our April 2025 Community…

Kudos to the March Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 146,660 Most Valuable Professional

#2
RandyHayes Profile Picture

RandyHayes 76,287 Super User 2024 Season 1

#3
Pstork1 Profile Picture

Pstork1 66,004 Most Valuable Professional

Leaderboard

Featured topics

Restore a deleted flow