cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
FMontesRNX1
Resolver II
Resolver II

Repeat string values on Concat

So, this is the scenario, I have a Gallery with items, and 1 slider control, where the max value is their stock on the source table.
The slider represents the pieces to request, so someone can use the slider to select a specific number of pieces that they want to use, but never exceeding the stock.
Now, for the consumption registry, I need to me to have a string with the item, repeated so many times as the slider value is set.

Example: The item is apple, stock is 5, I selected 2 on slider, the string should be: apple;apple

Finally, I expect to see requests like this

apple;apple;banana;banana;banana;orange

This works for me because I see information about their locations and other information operations, so use a string like
apple(2);banana(3);orange(1)
Doesn't work for my app.

This is my current string to concatenate the selected Values:
Concat(Filter(Gallery1.AllItems,Slider1.Value > 0).Title, Title &";")

But with this, isn't considering the slider value, so appears: apple;banana;orange

As previously mentioned I can use this, but for other information operations is more complicated to use to other App functions. 

Concat(Filter(Gallery28.AllItems,Slider1.Value > 0).Title, Title & " (" & Slider1.Value & ")" & ";")

I tried 2 ways without success:

 

1:
ForAll(Filter(Gallery28.AllItems,Slider1.Value > 0),
 Concat(Filter(Gallery28.AllItems,Slider1.Value > 0), Title &";")

)

2:
Concat(Filter(Gallery28.AllItems,Slider1.Value > 0),ForAll(Filter(Gallery28.AllItems,Slider1.Value > 0), Title &";"))

I think this should be easy, but sincerely I don't have more ideas for now.

 

Any ideas?

1 ACCEPTED SOLUTION

Accepted Solutions
RandyHayes
Super User
Super User

@FMontesRNX1 

Please consider changing your Formula to the following:

Concat(
    Filter(Gallery1.AllItems,Slider1.Value > 0).Title As _item, 
         Concat(Sequence(Slider1.Value), _item.Title & ";")
    )
)

 

I hope this is helpful for you.

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up below. Solved your problem? - Click on Accept as Solution below. Others seeking the same answers will be happy you did.
NOTE: My normal response times will be Mon to Fri from 1 PM to 10 PM UTC (and lots of other times too!)
Check out my PowerApps Videos too! And, follow me on Twitter @RandyHayes

Really want to show your appreciation? Buy Me A Cup Of Coffee!

View solution in original post

2 REPLIES 2
RandyHayes
Super User
Super User

@FMontesRNX1 

Please consider changing your Formula to the following:

Concat(
    Filter(Gallery1.AllItems,Slider1.Value > 0).Title As _item, 
         Concat(Sequence(Slider1.Value), _item.Title & ";")
    )
)

 

I hope this is helpful for you.

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up below. Solved your problem? - Click on Accept as Solution below. Others seeking the same answers will be happy you did.
NOTE: My normal response times will be Mon to Fri from 1 PM to 10 PM UTC (and lots of other times too!)
Check out my PowerApps Videos too! And, follow me on Twitter @RandyHayes

Really want to show your appreciation? Buy Me A Cup Of Coffee!

It works!
Thanks a lot
Regards

Helpful resources

Announcements
PA Virtual Workshop Carousel 768x460.png

Register for a Free Workshop

This training provides practical hands-on experience in creating Power Apps solutions in a full-day of instructor-led App creation workshop.

Microsoft Build 768x460.png

Microsoft Build is May 24-26. Have you registered yet?

Come together to explore latest innovations in code and application development—and gain insights from experts from around the world.

May UG Leader Call Carousel 768x460.png

What difference can a User Group make for you?

At the monthly call, connect with other leaders and find out how community makes your experience even better.

Top Solution Authors
Top Kudoed Authors
Users online (3,209)