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

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / find a particular numb...
Power Automate
Unanswered

find a particular number within the string of value

(0) ShareShare
ReportReport
Posted on by 8

I have a loop starting from 1 to 10000 with step 1. However, whenever the value "5" appears in any of the digits of the loop index, e.g. 5, 55, 151, then the loop index should increase by 1. 

Below are the codes, but they do not work as desired. Any help would be appreciated.

LOOP LoopIndex FROM 1 TO 10000 STEP 1
Text.FromNumber Number: LoopIndex DecimalPlaces: 0 UseThousandsSeparator: False FormattedNumber=> LoopIndex
IF Contains(LoopIndex, 5, True) THEN
Variables.IncreaseVariable Value: LastIndex IncrementValue: 1
END
.....



  • MichaelAnnis Profile Picture
    5,727 Moderator on at

    Do not overwrite LoopIndex, use a different variable for the formatted number. 

  • Nived_Nambiar Profile Picture
    18,138 Super User 2026 Season 1 on at

    Hi @winfs 

     

    bit confused based on your code, as per the code, i could see you are trying to increment the LastIndex variable, which seems to be working as expected, may i know what is the exact issue and and what is the expected result ?

     

    Thanks & Regards,

    Nived N 🚀

    LinkedIn: Nived N's LinkedIn
    YouTube: Nived N's YouTube Channel

    🔍 Found my answer helpful? Please consider marking it as the solution!
    Your appreciation keeps me motivated. Thank you! 🙌

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

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Leaderboard > Power Automate

#1
Mohsin Ali Profile Picture

Mohsin Ali 432

#2
11manish Profile Picture

11manish 313 Super User 2026 Season 2

#3
M Bilal Khan Profile Picture

M Bilal Khan 154

Last 30 days Overall leaderboard