cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
MiteshGovan
Post Patron
Post Patron

Repeating table dropdown

Hi

 

Repeating table isn't working properly. 

 

MiteshGovan_0-1619020395148.png

 

It is only showing one item instead of 3 different line. How do I patch it as 3 different line items.

 

ForAll(MedsList,Patch('CP List',Defaults('CP List'),{Title:Dropdown4.Selected.Title,Quantity:Value(inputquantity.Text),Dosage:inputdosage.Text,Period:Value(inputperiod.Text),NewIDs:Form2.LastSubmit.ID}))

 

Thank you

1 ACCEPTED SOLUTION

Accepted Solutions

@MiteshGovan 

My sincere apology that your post dropped off of my "radar".  

I had put some things together for the other post based on this and then got a little lost between the two posts and then simply forgot to get back to it.

 

Are you still struggling with this?

 

So to recap - it was my understanding that you wanted all the items in the Gallery to be added as rows to your list.  Is that the case?

 

Your formula should be based on the Gallery, not a collection.  So the formula should be:

Collect(
    ForAll(yourGallery.AllItems, 
      {Title:Dropdown4.Selected.Title,
       Quantity:Value(inputquantity.Text),
       Dosage:inputdosage.Text,
       Period:Value(inputperiod.Text),
       NewIDs:Form2.LastSubmit.ID
      }
    )
)

I assume you have this in the OnSuccess action of the Form2!?

_____________________________________________________________________________________
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

6 REPLIES 6
RandyHayes
Super User
Super User

@MiteshGovan 

I think we might have been working on this in another post.  I might have some outstanding response for you still as I am working my way back through message responses.

 

Can you explain a little more on this scenario?  

From your formula, I see you are creating a Table with a ForAll based on the MedsList (what is that?) to then do a Patch to the CP List to create new records.

The iterator for the ForAll table will be the MedsList, so can you explain what that is?

 

 

_____________________________________________________________________________________
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!

Hi @RandyHayes 

 

I know it was from another post but there wasn't a solution to that problem so I had to think of something else.

 

The Medlist is a collection.
Patch(MedsList,ThisItem,{Meds:Dropdown4.Selected.Title,Dosage:inputdosage.Text,Quanity:inputquantity.Text,Period:Value(inputperiod.Text)}); Collect(MedsList,{Meds:"",Dosage: "",Quanity: "",Period: 0})

 

RandyHayes
Super User
Super User

@MiteshGovan 

Yes, I was still on that other post, just hadn't gotten back to it.  I have a complicated response rotation schedule where today's posts get answered first and then I flush through prior responses.  So, sorry on that - I do have a solution for you on the other, just need to type it out.

 

Thanks for the info on the collection.  However, again, your original formula is iterating over all of these records.

And I guess I am not seeing the issue from the original picture.  You show two items in your Gallery of two types and three records in your list of the same type.  I know this is not what you want, but can you explain what you were expecting?

_____________________________________________________________________________________
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!

HI @RandyHayes 

 

Thank you for your assistance. That will be awesome.

 

I have selected the below items. 

 

MiteshGovan_0-1619025820712.png

 

But my end result I am seeing the below.

MiteshGovan_1-1619026010280.png

 

 

 

Hi @MiteshGovan,

Have you ever solved your problem?

Based on the issue that you mentioned, do you want to save the item to the SP list once you click the save icon within a section of the Gallery?

Could you please share a bit more about the scenario?

From your screenshot, I think you have something misunderstanding with the ForAll() function. 

Please modify the formula as below:

Patch('CP List',Defaults('CP List'),{Title:Dropdown4.Selected.Title,Quantity:Value(inputquantity.Text),Dosage:inputdosage.Text,Period:Value(inputperiod.Text),NewIDs:Form2.LastSubmit.ID})

Note that just remove the ForAll() function because it will save a same record as many as the total rows of the collection. 

This modified formula helps you save a single record to SP list once you click the corresponding save icon.

Check if it helps.

Regards,

Qi

Best Regards,
Qi

@MiteshGovan 

My sincere apology that your post dropped off of my "radar".  

I had put some things together for the other post based on this and then got a little lost between the two posts and then simply forgot to get back to it.

 

Are you still struggling with this?

 

So to recap - it was my understanding that you wanted all the items in the Gallery to be added as rows to your list.  Is that the case?

 

Your formula should be based on the Gallery, not a collection.  So the formula should be:

Collect(
    ForAll(yourGallery.AllItems, 
      {Title:Dropdown4.Selected.Title,
       Quantity:Value(inputquantity.Text),
       Dosage:inputdosage.Text,
       Period:Value(inputperiod.Text),
       NewIDs:Form2.LastSubmit.ID
      }
    )
)

I assume you have this in the OnSuccess action of the Form2!?

_____________________________________________________________________________________
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!

Helpful resources

Announcements
Power Platform Conf 2022 768x460.jpg

Join us for Microsoft Power Platform Conference

The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.

Power Platform Call June 2022 768x460.png

Power Platform Community Call

Join us for the next call on June 15, 2022 at 8am PDT.

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.

PA.JPG

New Release Planning Portal (Preview)

Check out our new release planning portal, an interactive way to plan and prepare for upcoming features in Power Platform.

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