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 Apps / Missing last value usi...
Power Apps
Answered

Missing last value using Sequence function

(0) ShareShare
ReportReport
Posted on by 124

Hi,

 

I'm trying to generate a list of parking places based on a range.

 

From the string "S1.01-S1.28", I generate a table ["S1.01"; "S1.02"; ... ; "S1.28"].

This works well...

 

However, I'm trying to do the same thing for "S1.01-1.43" and the last item ("S1.43") is missing, I can't figure out why.

 

Here is my code:

 

Clear(tempCollection);;
Clear(tempCollectionCurrent);;

ForAll(
 ["S1.01-S1.28"] As range; // //"D1.01-D1.43
 With(
 {
 rangeParts: Split(
 Substitute(
 range.Value;
 ".";
 ","
 );
 "-"
 )
 };
 With(
 {
 min: Value(
 Right(
 First(rangeParts).Value;
 Len(First(rangeParts).Value) - 1
 )
 );
 max: Value(
 Right(
 Last(rangeParts).Value;
 Len(First(rangeParts).Value) - 1
 )
 )
 };
 Notify($"min: {min}; max: {max}");;
 RemoveIf(tempCollectionCurrent; true);;
 ForAll(
 Sequence(
 Abs(min-max)*100 + 1;
 min;
 0,01
 ) As diff;
 Collect(
 tempCollectionCurrent;
 Concatenate("D";
 Substitute(
 Left(
 Concatenate(
 diff.Value;
 "0"
 );
 4
 );
 ",";
 "."
 )
 )
 );;
 Notify(
 Substitute(
 Left(
 Concatenate(
 diff.Value;
 "0"
 );
 4
 );
 ",";
 "."
 )
 );;
 )
 )
 );;
 Collect(
 tempCollection;
 {
 places:tempCollectionCurrent
 }
 );;
)

 

Categories:
I have the same question (0)
  • mmbr1606 Profile Picture
    14,605 Super User 2026 Season 1 on at

    hey @BaptisteW 

     

    can u try this instead:

    Clear(tempCollection);
    Clear(tempCollectionCurrent);
    
    ForAll(
     Split("S1.01-1.43", ";"),
     With(
     {
     rangeParts: Split(Substitute(Substitute(Value, "S", ""), ".", ","), "-"),
     prefix: "S"
     },
     With(
     {
     minNum: Value(First(rangePages).Result),
     maxNum: Value(Last(rangeParts).Result)
     },
     ForAll(
     Sequence(maxNum - minNum + 1, minNum, 1),
     Collect(
     tempCollectionCurrent,
     Concatenate(prefix, Text(Value, "[$-en-US]000"))
     )
     )
     )
     );
     Collect(tempCollection, {places: tempStorageCurrent})
    );
    

     

    Let me know if my answer helped solving your issue.

    If it did please accept as solution and give it a thumbs up so we can help others in the community.



    Greetings

  • v-yueyun-msft Profile Picture
    Microsoft Employee on at

    Hi , @BaptisteW 

    Based on your description, you want to split your string. My separator here is not the same as your decimal point. The decimal point I have here is  a point "." instead of ",".

    Your expression separator is a semicolon and my comma.

    So i make a test in my side ,  i use this code:

    Clear(tempCollectionCurrent);
    Set(Data2 , ["S1.01-S1.43"] );
    Set(rangeParts, Split(First(Data2).Value,"-") );
    Set(min ,Value(Right( First(rangeParts).Value, Len(First(rangeParts).Value) - 1) ) *100 );
    Set(max ,Value(Right( Last(rangeParts).Value, Len(First(rangeParts).Value) - 1) )*100 );
    Set(data3, ForAll( Sequence(Abs(min-max)+ 1,min, 1) , { Value : Text( Value/100,"0.00") }) );
    ForAll(data3,Collect(tempCollectionCurrent ,"D" & ThisRecord.Value ) )
     
    And this is the return for each variable:
    vyueyunmsft_0-1718268073704.png

    I've circled me anywhere you can try to modify in your code. You can try to make changes in your code. I'm sorry, but it's a bit difficult for me to modify your code directly due to the symbol difference.

     

    If this reply can help you , you can click mark this reply as solution (Accept solution) which can help more people, thanks in advance! 

     

    Best Regards,

    Yueyun Zhang

     

     

  • BaptisteW Profile Picture
    124 on at

    It's working, thank you! 🙂

     

    Not sure why the "0,01" increment wasn't working but I'll take it

  • BaptisteW Profile Picture
    124 on at

    Hi @v-yueyun-msft , thank you for your answer which I thought was working well but I'm facing the same issue for "E1.01-E1.15" (missing E1.15) and "L4.01-L4.10" (missing L4.10)

    BaptisteW_0-1718607084904.png

    The others seem to be working fine.
    Any idea why?

  • Verified answer
    v-yueyun-msft Profile Picture
    Microsoft Employee on at

    Hi , @BaptisteW 

    This is strange , but you can add the round to ensure it do not return 0.9999998:

    Clear(tempCollectionCurrent);
    Set(Data2 , ["E1.01-E1.15"] );
    Set(rangeParts, Split(First(Data2).Value,"-") );
    Set(min ,Round(Value(Right( First(rangeParts).Value, Len(First(rangeParts).Value) - 1) ) *100,0) );
    Set(max ,Round( Value(Right( Last(rangeParts).Value, Len(First(rangeParts).Value) - 1) )*100,0 ) );
    Set(data3, ForAll( Sequence(Abs(min-max)+ 1,min, 1) , { Value : Text( Value/100,"0.00") }) );
    ForAll(data3,Collect(tempCollectionCurrent ,"D" & ThisRecord.Value ) )
     

    If this reply can help you , you can click mark this reply as solution (Accept solution) which can help more people, thanks in advance! 

     

    Best Regards,

    Yueyun Zhang

  • BaptisteW Profile Picture
    124 on at

    That was it! Thank you very much 🙂

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Leaderboard > Power Apps

#1
Haque Profile Picture

Haque 70

#2
WarrenBelz Profile Picture

WarrenBelz 64 Most Valuable Professional

#3
Kalathiya Profile Picture

Kalathiya 36 Super User 2026 Season 1

Last 30 days Overall leaderboard