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

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.

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

 

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Helper II
Helper II

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
Highlighted
Dual Super User III
Dual Super User III

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!

Highlighted
Helper II
Helper II

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?

Highlighted
Helper II
Helper II

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 and data sampleSP List structure and data sample

 

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

 

drop-down is blank, but data is there? I don't understanddrop-down is blank, but data is there? I don't understand

 

 

Highlighted
Community Champion
Community Champion

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.

Highlighted
Helper II
Helper II

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,

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

Highlighted
Community Champion
Community Champion

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?

Highlighted
Helper II
Helper II

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
Check this Out

Helpful information

Featuring samples like Return to the Workplace and Emergency Response Applications

August 2020 Community Challenge: Can You Solve These?

August 2020 Community Challenge: Can You Solve These?

We're excited to announce our first cross-community 'Can You Solve These?' challenge!

secondImage

Return to Workplace

Reopen responsibly, monitor intelligently, and protect continuously with solutions for a safer work environment.

secondImage

Super Users Coming in August

We are excited for the next Super User season.

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,769)