web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / Extract values from list
Power Automate
Answered

Extract values from list

(0) ShareShare
ReportReport
Posted on by

Hi,

 

I have the following from a multi select question on a form:

 

["Item 1 - £15.75","Item 4 - £16.94","Item 5 - £6.39","Item 7 - £12.00"]

 

I want to extract the £ values and then have the ability to add them up in a subsequent step.

 

Can any one assist?

 

Jon 

Categories:
I have the same question (0)
  • abm abm Profile Picture
    32,865 Most Valuable Professional on at

    Hi @Anonymous 

     

    You could do this in different ways. 

     

    Read each values from the array. Next for each value use a split function to split the values between '-'. Finally again use a replace function to remove the pound sign. Then add this to a variable and increment every time.

     

    If you want more help let me know. I could send some sample flow steps for you.

     

    Thanks

     

     

  • Jay-Encodian Profile Picture
    2,920 on at

    Hey @Anonymous 

    Here you go:

    A.png

    Expressions for ease of copying:

    Compose: split(replace(replace(replace(variables('Value'),'[',''),']',''),'"',''),',')

    Compose - Split: split(items('Apply_to_each'),'£')

    Compose - Add the Values: add(variables('Total'),float(outputs('Compose_-_Split')[1]))

    Output:

    A.png

    HTH

    Jay

    -------------------------------------------------------------------------

    If I have answered your question, please mark your post as Solved.

    If you like my response, please give it a Thumbs Up.

  • Community Power Platform Member Profile Picture
    on at

    Hi Jay,

     

    I am still having issues with this, please see my setup and then the error:

     

    setup.JPGcompose error.JPG

  • Community Power Platform Member Profile Picture
    on at

    Full result below

     

    1.JPG

     

    2.JPG

    3.JPG

  • Jay-Encodian Profile Picture
    2,920 on at

    Hey @Anonymous 

    You need to wrap the first parameter in the add() expression with the float() expression (as per the second parameter) as it is not in the correct format:

    2.png

    HTH

    Jay

  • Verified answer
    Jay-Encodian Profile Picture
    2,920 on at

    @Anonymous 

    Having said that... it looks like your adding the output of the compose action with the value from the body (get response details).... this isn't correct.

    You need to add the output of the compose action to the value of the 'Total' float variable... that way each time the for each processes an item in the array the 'Total' variable is incremented.

    HTH

    Jay

  • Community Power Platform Member Profile Picture
    on at

    Hi,

     

    Thanks for your help so far, I have made the change to the compose action:

     

    add(float(body('Get_response_details')?['rdcceec6ad947470a85506d8dca8ef8ed']),float(outputs('Compose_check')))
     
    But still getting an error:
    error.JPG
     
  • Community Power Platform Member Profile Picture
    on at

    Thanks Jay, all sorted now !

     

    Cheers for your help.

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

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 503 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 321 Moderator

#3
abm abm Profile Picture

abm abm 237 Most Valuable Professional

Last 30 days Overall leaderboard