Hello all,
In my survey I have the user choose an account ID (txt_Acct_ID) from a list which then auto-populates a number of answers from a csv file. In the case of a Mailing Address pre-populating a multi-line textbox, I am trying to concatenate a number of separate fields from the csv with newline calls injected. Example:
MailAddress1
MailAddress2
City, State Zipcode
Here is one thing I tried:
if(${int_ID_sel}>0,concat(pulldata('feed_mans','MailAddress1','AccountID',${txt_Acct_ID})+'\n'+pulldata('feed_mans','MailCity','AccountID',${txt_Acct_ID})),'')
The result is:
MailAddress1\nMailAddress2
So it appears not to recognize the newline call. I have a number of workarounds but would like this to work if possible. The use case is to pre-populate the field but allow the user to update it. And for this purpose, it actually makes the most sense to put the entire address in one field.
Thanks!
Jim
Solved! Go to Solution.
Hi Jim,
Is it providing the 'MailAddresss1' literally, as in the pulldata is not working? If so, try placing them in calculate fields. '\n' is working for me in calculations - a simple sample:
type | name | label | appearance | calculation |
---|---|---|---|---|
text | text1 | Enter some text: | ||
text | text2 | Here's a multiline: | multiline | concat(${example},"\n","hello") |
Hi Jim,
Is it providing the 'MailAddresss1' literally, as in the pulldata is not working? If so, try placing them in calculate fields. '\n' is working for me in calculations - a simple sample:
type | name | label | appearance | calculation |
---|---|---|---|---|
text | text1 | Enter some text: | ||
text | text2 | Here's a multiline: | multiline | concat(${example},"\n","hello") |
Hi James,
The pulldata is working great. I just was using the 'MailAddress1' for this example. It seemed clearer when I wrote it. I do have it in the Calculate field but it was not working with single quotes. I just replaced the single quotes with double quotes only on the \n and that gave the newline in the text box. So here was the final calculation:
if(${int_ID_sel}>0,concat(pulldata('feed_mans','MailAddress1','AccountID',${txt_Acct_ID})+"\n"+pulldata('feed_mans','MailCity','AccountID',${txt_Acct_ID})),'')
I just simply got the quotes mixed up.
Thanks for the quick reply!
-Jim
Does this work in the Web App version for use in Experience and Dashboard Editors?
For me the Newline ,"/n", works great on the field app, but not on the Web App, which simply shows:
\n\n, Coldwater, RoW Status: Clearing, Grading; TEL Assessment Status(s): 3 (SM) \n\n Bedrock
Using code:
concat('Bedrock Type:',${Bedrock_Type},"\n",'Observed from: ',${Bedrock_KPRge},"\n",'Bedrock Depth: " ',${Bedrock_Depth},' m, Bedrock Depth Range: ',${BedrockDepth_Rge},"\n",${Sample_Reason_Cct},'; # Samples: ',${Nmbr_SamplesPerActivity})
Is there any workaround/update for adding newlines for surveys accessed through the web app?
@FieldUser1One Did you ever find a way to get this to work in the web app?
As long as appearance column is set to "multiline" using concat with "\n" works ok for me. ie concat(${initials}, "\n", ${surname )