cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Helper I
Helper I

Selection range of numbers from dropdown

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

1 ACCEPTED SOLUTION

Accepted Solutions

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



View solution in original post

3 REPLIES 3
Resident Rockstar
Resident Rockstar

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

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

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



View solution in original post

Helpful resources

Announcements
Community Conference

Power Platform Community Conference

Check out the on demand sessions that are available now!

News & Announcements

Community Blog

Stay up tp date on the latest blogs and activities in the community News & Announcements.

secondImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Community Highlights

Community Highlights

Check out the Power Platform Community Highlights

Top Solution Authors
Top Kudoed Authors
Users online (12,861)