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
Highlighted
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.

View solution in original post

5 REPLIES 5
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.

Highlighted
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.

View solution in original post

Helpful resources

Announcements
thirdimage

Power Automate Community User Group Member Badge

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

sixthImage

Power Platform World Tour

Find out where you can attend!

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

fifthimage

Microsoft Learn

Learn how to build the business apps that you need.

Top Kudoed Authors
Users Online
Currently online: 106 members 5,298 guests
Please welcome our newest community members: