0

I need some help to see if I can duplicate a text box using Button in Power Apps. I have to the Text box and a button in my power apps, and what I am trying to achieve is if the users need more Text boxes, they click on the button, and the following text box will display.

enter image description here

Kind Regards

1 Answer 1

0

I think you'll want to use a collection and a gallery to achieve this.

  1. Create a blank collection
ClearCollect(
    colLinkGallery,
    {Link: ""}
)

enter image description here

  1. Insert a gallery. Use the collection created above as the data source. Add a Text Input field and a button (and a label if you'd like) enter image description here

  2. Set the Text Input control's default value to ThisItem.Link enter image description here

  3. Set the OnSelect property of the button to

Patch( colLinkGallery, ThisItem, {Link: TextInput1.Text} ); Collect( colLinkGallery, {Link: ""} )

enter image description here

  1. Set the Visible property of the button to IsBlank(ThisItem.Link) enter image description here

When used it should look something like this: enter image description here

  1. At this point I assume you'd need to save the collection of links to a data source somewhere, however I'm not sure what your actual requirements are, so you'd need to explore this further.

Shane Young has some good videos on this concept which may be worth watching.

Part 1 here: https://www.youtube.com/watch?v=xgznk4XlPCo

2
  • Thanks for your message, I just need it to save back to SharePoint. I watched the Shane video and for some reason he has created two separate SharePoint list as I prefer to save everything in one list.
    – Harris
    Feb 7, 2022 at 5:53
  • Without knowing what the structure of your SharePoint list (and PowerApp) looks like, it's hard to provide any decent guidance. I am assuming there is more to it than just these links. In that case, one option would be to concatenate all the values in "colLinkGallery" along with some sort of separating character and patch that back to your SharePoint list. However, using a child list would be a better option with simpler formulas. If all you're doing is saving these links as new individual list items, things would be quite simple.
    – user79408
    Feb 7, 2022 at 21:27

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.