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 / Selection range of num...
Power Apps
Answered

Selection range of numbers from dropdown

(0) ShareShare
ReportReport
Posted on by 32

Hi All,

How to achieve the following scenario. I couldn't select the range of serials from the SQL table based on the user selection.

 

I have 2 dropdowns of serial numbers. The user has to select the first and last serials available.

I need to print all the selected range of serials in the textbox and the total selected.

 

Data is from SQL table "SerialsNumbers"

 

Please see the figure below.

 

Kldmurshed_0-1602007792746.png

 

Your help is appreciated.

Thanks

Categories:
I have the same question (0)
  • Vijay Tailor Profile Picture
    2,961 on at

    Hi @Kldmurshed ,

    Please find the below solution for your requirement.


    Please below code in Button OnSelect Property.
    Note:- change your DropDown Name.

    Clear(RangeGereateColl1);
    UpdateContext({StartValue:Value(Dropdown5.Selected.Value)});
    UpdateContext({EndValue:Value(Dropdown5_1.Selected.Value)});
    UpdateContext({RangeValue:EndValue-StartValue});
    ClearCollect(SeqColl,Sequence(RangeValue));
    ForAll(SeqColl,
    Collect(RangeGereateColl1,{RangeValueColumn:StartValue+ThisRecord.Value});
    );


    Code for TextInput Default - 

    Concat(RangeGereateColl1,Text(RangeValueColumn),",")

    See the below-attached Demo for reference - 
    RangeGenerateBy DropDOwn.gif
    Thanks,

    Please click "Accept as Solution" if my post answered your question so that others may find it more quickly. If you found this post helpful consider giving it a "Thumbs Up."-Vijay

  • Kldmurshed Profile Picture
    32 on at

    Thank you @VijayTailor 

     

    Your code is almost perfect. But the first serial which is selected doesn't show in the result.

    Could you please fix it so that I can accept the solution?

     

    Thanks

  • Verified answer
    Vijay Tailor Profile Picture
    2,961 on at

    Hi @Kldmurshed ,

    See the Modified code below - for Button 

    Clear(RangeGereateColl1);
    Collect(RangeGereateColl1,{RangeValueColumn:Value(Dropdown5.Selected.Value)}); //New Added
    UpdateContext({StartValue:Value(Dropdown5.Selected.Value)});
    UpdateContext({EndValue:Value(Dropdown5_1.Selected.Value)});
    UpdateContext({RangeValue:EndValue-StartValue});
    ClearCollect(SeqColl,Sequence(RangeValue));
    ForAll(SeqColl,
    Collect(RangeGereateColl1,{RangeValueColumn:StartValue+ThisRecord.Value});
    );

    VijayTailor_0-1602015268290.png

    Thanks,

    Please click "Accept as Solution" if my post answered your question so that others may find it more quickly. If you found this post helpful consider giving it a "Thumbs Up."-Vijay



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!

Congratulations to the March Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
Vish WR Profile Picture

Vish WR 914

#2
11manish Profile Picture

11manish 627

#3
Valantis Profile Picture

Valantis 598

Last 30 days Overall leaderboard