cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
gautmish
Level: Powered On

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
Community Support Team
Community Support Team

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.
5 REPLIES 5
Highlighted
Pat_Wickramage
Level: Powered On

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.

Pat_Wickramage
Level: Powered On

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.

gautmish
Level: Powered On

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

Pat_Wickramage
Level: Powered On

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.

Community Support Team
Community Support Team

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.

Helpful resources

Announcements
firstImage

Microsoft Business Applications Virtual Launch Event

Join us for an in-depth look at the new innovations across Dynamics 365 and the Microsoft Power Platform.

firstImage

Watch Sessions On Demand!

Continue your learning in our online communities.

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

FirstImage

Power Platform World Tour

Coming to a city near you

thirdimage

PowerApps Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

FourthImage

Join PowerApps User Group!!

Connect, share, and learn with your peers year-round

Top Kudoed Authors
Users Online
Currently online: 183 members 4,867 guests
Please welcome our newest community members: