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

Create data field on button click

Hi

 

I want to generate textbox in the form on button click . 

 

Scenario : Form with Quote field , number of quote may change in each request . So I want to provide an add button to user, on-click it should add one more textbox to add a new quote . I know i can not create a new column on SP list but I can store all the quotes with comma separated . So I just want to build the form for enduser , where they will fill quotes in different text fields.

 

Please let me know if you need any more information .

 

Thanks

Gautmish

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Community Support
Community Support

Re: Create data field on button click

Hi @gautmish,

 

This can be achieved, but not inside a Form control. You need to create the textinput control outside the form, and then use a Patch function to update the records to SharePoint list. 

 

In Screen1, add multipleTextInput controls and a button control, set below formulas to make this work:

 

Screen1.OnVisible=Set(Number,1)
Button1.OnSelect=Set(Number,Number+1)
TextInput2.Visible=If(Number>=2,true,false)
TextInput3.Visible=If(Number>=3,true,false)
TextInput4.Visible=If(Number>=4,true,false)
...
....
.....

About how to use Patch to create a new record, the formula should be something like:

Patch(List,Defaults(List),
{Title:
Concatenate(TextInput1.Text," ",TextInput2.Text," ",TextInput3.Text),
...})

 Capture.PNG

 

Regards,

Mona

Community Support Team _ Mona Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

5 REPLIES 5
Highlighted
Helper III
Helper III

Re: Create data field on button click

Hi @gautmish

 

To add a field at button click, you can use popup.

Basically insert a text box & set the 'visible' parameter to Popup = true

And insert a button and put 'onselect' parameter to Updatecontext({Popup: true}).

 

So when a user clicks on the button the text box would appear.

Highlighted
Helper III
Helper III

Re: Create data field on button click

One more thing, on your 'Save' button again use 'Updatecontext' to make Popup:false.

 

Then the text box would be gone after saving.

Highlighted
Helper III
Helper III

Re: Create data field on button click

Hi @Pat_Wickramage,

 

Thank you for your Reply . As i have mentioned , we are not sure , how many quotes we needed per request . So it will be difficult to create predefined textboxes and change the visible property . 

 

Thanks

Gautmish

Highlighted
Helper III
Helper III

Re: Create data field on button click

Noted. I had a similar requirement sometime back & de client was happy with 3 new fields. So it wasnt a major issue for me.

Good luck.

Highlighted
Community Support
Community Support

Re: Create data field on button click

Hi @gautmish,

 

This can be achieved, but not inside a Form control. You need to create the textinput control outside the form, and then use a Patch function to update the records to SharePoint list. 

 

In Screen1, add multipleTextInput controls and a button control, set below formulas to make this work:

 

Screen1.OnVisible=Set(Number,1)
Button1.OnSelect=Set(Number,Number+1)
TextInput2.Visible=If(Number>=2,true,false)
TextInput3.Visible=If(Number>=3,true,false)
TextInput4.Visible=If(Number>=4,true,false)
...
....
.....

About how to use Patch to create a new record, the formula should be something like:

Patch(List,Defaults(List),
{Title:
Concatenate(TextInput1.Text," ",TextInput2.Text," ",TextInput3.Text),
...})

 Capture.PNG

 

Regards,

Mona

Community Support Team _ Mona Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

Helpful resources

Announcements
Community Conference

Power Platform Community Conference

Find your favorite faces from the community presenting at the Power Platform Community Conference!

Watch Now

Experience what’s next for Power Apps

See the latest Power Apps innovations, updates, and demos from the Microsoft Business Applications Launch Event.

Power Platform ISV Studio

Power Platform ISV Studio

ISV Studio is designed to become the go-to Power Platform destination for ISV’s to monitor & manage published applications.

secondImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Top Solution Authors
Top Kudoed Authors
Users online (7,750)