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

copy concat values from multiple form fields into another field on button click

Hello,

Just getting into building PowerApps forms. In this case, I'm building a form to enter data into a SharePoint List. I have 4 form elements (separate from the form bound to SP List) that I want to concatenate into a single string delimited by underscores and then enter them into the form field bound to a column in the SharePoint List.

 

I have a button ready to go, I'm just not sure how to configure the button to grab the 4 values and set the value on the form field.

Any guidance greatly appreciated.

form_build_fields_onchange.pngtop 4 controls pull data from separate SP List. Form bound to SP LIst last 2 form elements.

 

1 ACCEPTED SOLUTION

Accepted Solutions
EmilioatUplyft
Level: Powered On

Re: copy concat values from multiple form fields into another field on button click

Thank you for responding @Eelman 

 

First up, here is the script I used to get the input control to be both settable via button and work properly in View mode.

If(SharePointForm1.Mode=1, variable, Parent.Default)

 The code you provided evaluates to 'edit' in both Edit mode and New mode so I needed a way to detect for just New mode.

 

I'll move the question about Filter() and Cascading Combo controls to a new Thread for better usability. 

 

Cheers,

View solution in original post

7 REPLIES 7
Dual Super User
Dual Super User

Re: copy concat values from multiple form fields into another field on button click

Hey @EmilioatUplyft 

 

To configure this, you can set the configuration as:

Button -> OnSelect -> Set(ConcatenatedValue, Concatenate(OperatingSystemDropdown.Selected.Value,"_", PolicyContextDropdown.Selected.Value, "_",ApplicationNameDropdown.Selected.Value,"_", VersionTextInput.Text));Reset(DataCardValue12)

Now, unlock the datacard and set the Default value of the TextInput in policy_label as:

DataCardValue12 -> Default -> ConcatenatedValue

 

Hope this Helps!

 

If this reply has answered your question or solved your issue, please mark this question as answered. Answered questions helps users in the future who may have the same issue or question quickly find a resolution via search. If you liked my response, please consider giving it a thumbs up. THANKS!

EmilioatUplyft
Level: Powered On

Re: copy concat values from multiple form fields into another field on button click

Thank you kindly @yashag2255 . Your instructions helped me get the button working!

 

May I ask two related questions?

1) Now that I've created a PowerApps Custom Form for my SharePoint List, when I "View" records from the List, I want to hide the top 4 dropdown boxes and button, and just display the 2 columns' data, policy_label and comment.

2) In View mode, the input box "policy_label" is not pulling data from the underlying SharePoint List. How do I get the input box to pull data from the SharePoint List in View mode?

EmilioatUplyft
Level: Powered On

Re: copy concat values from multiple form fields into another field on button click

Dear @yashag2255 

Thank you kindly for your help so far, just need a little further guidance if you can :))

 

In regards to using the button to change the value of the input control I'm stuck there. If I set Default=Parent.Default, when I View/Edit existing SP List items, the correct value is retrieved, but I can't set the value with the button. If I set Default=variable, I can modify the value in the input control with the button when in New mode, but I can't use the form in View/Edit mode, because the stored value isn't retrieved into the input control. I mistakenly wrote "Edit" on my screenshots, when I meant "New".

 

I'm also stuck trying to Filter() the SP List. I could really use your help.

The 3 drop-down boxes are filtering a single SP LIst on 3 columns: node_os:policy_context:property_clusters

In the first drop-down, I set Items to: 
Sort(Distinct(intune_device_naming_convention_nodes,node_os),Result) and that works great.

 

In the second drop-down, Items: 
Distinct(Filter(intune_device_naming_convention_nodes,node_os=combo_devices_os.Selected.Result),policy_context)

However, all that that returns are blank items, in the correct number of entries. Meaning, there are 4 distinct records in SP and there are 4 blank drop-down items. 

 

Haven't gotten to the third drop-down yet, though I imagine its pretty similar to 2.

 

Any help is greatly appreciated!

SP_List_structure.pngSP List structure and data sample

 

form_build_fields_onchange2.pngif Default=Parent.Default, can't set value, if Default=variable, can't use in View/Edit Mode.

 

form_build_fields_onchange3.pngdrop-down is blank, but data is there? I don't understand

 

 

Eelman
Level 8

Re: copy concat values from multiple form fields into another field on button click

@EmilioatUplyft 

 

For the Default value use an If() statement, ie (I assume your form is called Form1 here):

 

If(Form1.Mode = DisplayMode.View || Form1.Mode = DisplayMode.Edit, Parent.Default, yourVariableName)

 

For the drop downs, use the new "Depends on" feature. I haven't used it as yet but here's an article on how it's done. Seems pretty straight forward but let us know if you get stuck.

 

https://powerapps.microsoft.com/en-us/blog/configure-easy-dependent-drop-downs-in-powerapps/

 

Hope this helps.

EmilioatUplyft
Level: Powered On

Re: copy concat values from multiple form fields into another field on button click

Thank you kindly @Eelman!

1) input control works correctly!!!

2) can't get "Depends on" working.

I followed instructions, used little builder and clicked Apply, but UI displays the warning icon and I can't find what is wrong with the formula - nothing is highlighted within the formula bar. DO I need to change the structure of the SP List or columns? Not sure.

 

Thank you kindly,

form_build_fields_onchange4.png"Depends on" completed. Warning persists, no items in combo box.

Eelman
Level 8

Re: copy concat values from multiple form fields into another field on button click

How do your dropdowns get their data? Is it from the one SP list? The best practice mentioned in that article I linked suggests you set up separate SP List with your dropdown options and dependents / children. It's possible that by using Distinct that this is causing some issues or at least adding complexity to setting up what you need?

EmilioatUplyft
Level: Powered On

Re: copy concat values from multiple form fields into another field on button click

Thank you for responding @Eelman 

 

First up, here is the script I used to get the input control to be both settable via button and work properly in View mode.

If(SharePointForm1.Mode=1, variable, Parent.Default)

 The code you provided evaluates to 'edit' in both Edit mode and New mode so I needed a way to detect for just New mode.

 

I'll move the question about Filter() and Cascading Combo controls to a new Thread for better usability. 

 

Cheers,

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 (Last 30 Days)
Users online (5,292)