cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Post Patron
Post Patron

concatenate a textbox value from other textboxes based on the value in 2 textboxes

I have a form with several textboxes.

Lets call them for this question textbox1, textbox2,textbox3

Label for textbox2 = "Customer_Supplier"

Label for textbox3 = "Rep_Agency"

Current value in textbox1 is    "This is a large customer"

 

if Textbox2 value  =  "Yes" then I need the value from textbox2 to concatenate to the current value in textbox1 and seperated by  ;(semicolon). But the Label name is also added.

So then value in Textbox1 is now  

This is a large customerCustomer_Supplier = Yes

 

if Textbox3 value  =  "Yes" then I need the value from textbox3 to concatenate to the current value in textbox1 and seperated by  ;(semicolon). But the Label name is also added.

So then value in Textbox1 is now  

"This is a large customerCustomer_Supplier = Yes; Rep Agency = Yes"

 

Thanks

Is this possible ?

Dave

 

 

 

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Dual Super User III
Dual Super User III

Re: concatenate a textbox value from other textboxes based on the value in 2 textboxes

Hi @DAVIDPOWELL 

 

The Concatenate function returns a string value, so you can sue this expression anywhere you can pass a string.

Yes, you can add it on a label on the "Text" property. The expression you shared is a bit different from what I shared with you, is there any difference in the logical expression?

Can you try to use the below expression?

If(DataCardValue17.Text = "Yes" || DataCardValue19.Text = "Yes", DataCardValue16.Text & ";" & DataCardKey17.Text & ";" & DataCardKey19.Text,DataCardValue16.Text )


This will check if either one of the DataCardValue are true and concatenate. If either of the two is empty, you might see two semicolons.

 

Concatenate(DataCardValue16.Text, If(!IsBlank(DataCardValue17.Text), ";"&Label2.Text&" = "&DataCardValue17.Text),If(!IsBlank(DataCardValue19.Text), ";"&Label3.Text&" = "&DataCardValue19.Text))


This will display the labels corresponding to the datacards here.

If this differs, please share more details about the logical implementation.

 

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!

View solution in original post

14 REPLIES 14
Highlighted
Community Support
Community Support

Re: concatenate a textbox value from other textboxes based on the value in 2 textboxes

Hi @DAVIDPOWELL ,

 

Sorry but I didn't fully understand what you want. Like " if Textbox2 value  =  "Yes" then I need the value from textbox2 to concatenate...", are Textbox2 and textbox2 two different label controls? What is the data source of your form? What are the column types of related fields?

 

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

Re: concatenate a textbox value from other textboxes based on the value in 2 textboxes

ok,

I just want to  concatenate 2 field  values if a condition exists in one of the textboxes.

I'm trying to create 2 variables then.

so in the OnChange for the datacards

Set(v_ASN,DataCardValue17.Text)

Set(v_NOTES,DataCardValue16.Text)

then just to get it to work.

Button-onselect

If(v_NOTES = "Yes",DataCardValue16.Text = v_NOTES && v_ASN)

Highlighted
Dual Super User III
Dual Super User III

Re: concatenate a textbox value from other textboxes based on the value in 2 textboxes

Hi @DAVIDPOWELL 

 

Can you try to use the expression as:

Concatenate(TextInput1.Text, If(TextInput2.Text = "Yes", ";"&Label2.Text&" = "&TextInput2.Text),If(TextInput3.Text = "Yes", ";"&Label3.Text&" = "&TextInput3.Text))

This will work in the case where you only want to check for Yes in the Textbox.

If you want to check if the textinputs are blank, you can use:

Concatenate(TextInput1.Text, If(!IsBlank(TextInput2.Text), ";"&Label2.Text&" = "&TextInput2.Text),If(!IsBlank(TextInput3.Text), ";"&Label3.Text&" = "&TextInput3.Text))

 

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
Post Patron
Post Patron

Re: concatenate a textbox value from other textboxes based on the value in 2 textboxes

@yashag2255 

 

Thank you very much  first !

where and what method/property should I use the expression ?

 

Dave

Highlighted
Post Patron
Post Patron

Re: concatenate a textbox value from other textboxes based on the value in 2 textboxes

ok   etall,

 

These are my actual values:

Concatenate(DataCardValue16.Text, If(DataCardValue17.Text = "Yes", ";"&"ASN"&" = "&DataCardValue17.Text),If(DataCardValue19.Text = "Yes", ";"&"EDI_SPS_Confirmations"&" = "&DataCardValue19.Text))

 

I tried putting this on a command button but will not work ??

 

Dave

Highlighted
Post Patron
Post Patron

Re: concatenate a textbox value from other textboxes based on the value in 2 textboxes

just for the heck of it:

I added a label to the form and set it "text" property to

If(DataCardValue17.Text = "Yes" Or DataCardValue19.Text = "Yes", DataCardValue16.Text & ";" & DataCardKey17.Text & ";" & DataCardKey19.Text,DataCardValue16.Text )    

 

and it worked fine,

but i still cant get the "DataCardValue16.Text"  to change to this evaluation ?

Highlighted
Dual Super User III
Dual Super User III

Re: concatenate a textbox value from other textboxes based on the value in 2 textboxes

Hi @DAVIDPOWELL 

 

The Concatenate function returns a string value, so you can sue this expression anywhere you can pass a string.

Yes, you can add it on a label on the "Text" property. The expression you shared is a bit different from what I shared with you, is there any difference in the logical expression?

Can you try to use the below expression?

If(DataCardValue17.Text = "Yes" || DataCardValue19.Text = "Yes", DataCardValue16.Text & ";" & DataCardKey17.Text & ";" & DataCardKey19.Text,DataCardValue16.Text )


This will check if either one of the DataCardValue are true and concatenate. If either of the two is empty, you might see two semicolons.

 

Concatenate(DataCardValue16.Text, If(!IsBlank(DataCardValue17.Text), ";"&Label2.Text&" = "&DataCardValue17.Text),If(!IsBlank(DataCardValue19.Text), ";"&Label3.Text&" = "&DataCardValue19.Text))


This will display the labels corresponding to the datacards here.

If this differs, please share more details about the logical implementation.

 

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!

View solution in original post

Highlighted
Post Patron
Post Patron

Re: concatenate a textbox value from other textboxes based on the value in 2 textboxes

Thanks

get a circular reference error on  this statement

if i put this in the text property of the Label2 object.

however, in the debug window the concatenation is giving me what i need !! .

but i just cant get the "DataCardValue16"  text to the result of  the formula ?

 

Concatenate(DataCardValue16.Text, If(!IsBlank(DataCardValue17.Text), ";"&Label2.Text&" = "&DataCardValue17.Text),If(!IsBlank(DataCardValue19.Text), ";"&Label3.Text&" = "&DataCardValue19.Text))

 fyi

 

Your other statement worked fine.

but i just cant get the "DataCardValue16"  text to the result of  the formula ?

Highlighted
Advocate IV
Advocate IV

Re: concatenate a textbox value from other textboxes based on the value in 2 textboxes

@DAVIDPOWELL 

 

If I understand you correctly... lets just say that your labels are named label2 for textbox2 and label3 for textbox3, etc.

 

Concatenate(TextInput1.Text,If(TextInput2.Text="Yes",Concatenate("; ",Label2.Text," = ",TextInput2.Text)),If(TextInput3.Text="Yes",Concatenate("; ",Label3.Text," = ",TextInput3.Text)))

 

However, you will not be able to put this back into TextBox1 as it will create a circular reference with TextBox1. The result needs to go into another control (textbox or label) or the initial "This is a large customer" needs to come from somewhere else.

 

Hope this helps,

Mike

Helpful resources

Announcements
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

Community User Group Member Badges

FIll out a quick form to claim your community user group member badge today!

secondImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Top Solution Authors
Top Kudoed Authors
Users online (4,323)