<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: If statement and add data to field in ArcGIS Survey123 Questions</title>
    <link>https://community.esri.com/t5/arcgis-survey123-questions/if-statement-and-add-data-to-field/m-p/807773#M12508</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&amp;nbsp;That's perfect thanks!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The&amp;nbsp;&lt;SPAN style="display: inline !important; float: none; background-color: transparent; color: #3d3d3d; font-family: arial,helvetica,'helvetica neue',verdana,sans-serif; font-size: 14px; font-style: normal; font-variant: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: left; text-decoration: none; text-indent: 0px; text-transform: none; -webkit-text-stroke-width: 0px; white-space: normal; word-spacing: 0px;"&gt;property('username')='Internal'&lt;/SPAN&gt; formula is giving me an error.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Also with&amp;nbsp;${Name}='Internal' as the relevant field, when a user logins in they don't see the fields, which is great. But when they submit data it doesn't grab their username or email from my pulldata function.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Another question though. Can you put an if on pulldata()? I want to check if the user is me (the internal account), if true then grab the email from a csv file I have as it contains emails for all users...since I can't pull from the AGOL account as it would pull my email and not the user's email.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 06 Nov 2018 16:35:02 GMT</pubDate>
    <dc:creator>joerodmey</dc:creator>
    <dc:date>2018-11-06T16:35:02Z</dc:date>
    <item>
      <title>If statement and add data to field</title>
      <link>https://community.esri.com/t5/arcgis-survey123-questions/if-statement-and-add-data-to-field/m-p/807767#M12502</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;What is the structure of an if/else statement in Survey123?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'm trying to check the username of the user, if true then grab the answer from a select one question, if not then just grab the username from the username question type. No luck so far&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 05 Nov 2018 19:07:05 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-survey123-questions/if-statement-and-add-data-to-field/m-p/807767#M12502</guid>
      <dc:creator>joerodmey</dc:creator>
      <dc:date>2018-11-05T19:07:05Z</dc:date>
    </item>
    <item>
      <title>Re: If statement and add data to field</title>
      <link>https://community.esri.com/t5/arcgis-survey123-questions/if-statement-and-add-data-to-field/m-p/807768#M12503</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;From the &lt;A href="https://doc.arcgis.com/en/survey123/desktop/create-surveys/xlsformformulas.htm"&gt;documentation&lt;/A&gt;:&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;if(&lt;SPAN style="color: #3366ff;"&gt;condition&lt;/SPAN&gt;, &lt;SPAN style="color: #339966;"&gt;a&lt;/SPAN&gt;, &lt;SPAN style="color: #ff0000;"&gt;b&lt;/SPAN&gt;)&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Where:&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;&lt;SPAN style="color: #3366ff;"&gt;&lt;STRONG&gt;condition&lt;/STRONG&gt;&lt;/SPAN&gt; is the statement to be evaluated&lt;/LI&gt;&lt;LI&gt;&lt;SPAN style="color: #339966;"&gt;&lt;STRONG&gt;a&lt;/STRONG&gt;&lt;/SPAN&gt; is the result if true&lt;UL&gt;&lt;LI&gt;${question}&lt;/LI&gt;&lt;/UL&gt;&lt;/LI&gt;&lt;LI&gt;&lt;SPAN style="color: #ff0000;"&gt;&lt;STRONG&gt;b&lt;/STRONG&gt;&lt;/SPAN&gt; is the result if false (else condition)&lt;UL&gt;&lt;LI&gt;property('username')&lt;/LI&gt;&lt;/UL&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The linked page has plenty of functions and operators to help you set up your if condition. If you're still stuck, describe exactly what you're trying to check and how, and someone can try to help you further.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 05 Nov 2018 19:28:13 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-survey123-questions/if-statement-and-add-data-to-field/m-p/807768#M12503</guid>
      <dc:creator>NickDierks1</dc:creator>
      <dc:date>2018-11-05T19:28:13Z</dc:date>
    </item>
    <item>
      <title>Re: If statement and add data to field</title>
      <link>https://community.esri.com/t5/arcgis-survey123-questions/if-statement-and-add-data-to-field/m-p/807769#M12504</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I have this:&lt;/P&gt;&lt;P&gt;if(${Name}='Internal', ${Call_In_Name}, ${Name})&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Where Name is the name of the account&lt;/P&gt;&lt;P&gt;Call_In_Name is a select one answer&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This is going into a textbox. I want to grab Call_In_Name if the username (Name) is equal to "Internal", else just grab the username (Name) and put it into the textbox&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;There is also a requirement to overwrite what's in textbox if the username is already in there and the user clicks on the select one question&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 05 Nov 2018 19:59:43 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-survey123-questions/if-statement-and-add-data-to-field/m-p/807769#M12504</guid>
      <dc:creator>joerodmey</dc:creator>
      <dc:date>2018-11-05T19:59:43Z</dc:date>
    </item>
    <item>
      <title>Re: If statement and add data to field</title>
      <link>https://community.esri.com/t5/arcgis-survey123-questions/if-statement-and-add-data-to-field/m-p/807770#M12505</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;So if I understand correctly, it sounds like you have two conditions to trigger ${Call_In_Name} being used in the textbox:&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;When ${Name}='Internal'&lt;/LI&gt;&lt;LI&gt;When an option in ${Call_In_Name} is selected&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For the second condition, you state "if the username is already in there and the user clicks on the select one question." Are there any situations where ${Call_In_Name} is selected, but you still want to use ${Name} instead? If not, then this should probably do what you need:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;if(string-length(${Call_In_Name})&amp;gt;0, ${Call_In_Name}, ${Name})&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;This checks to see if ${Call_In_Name} has been answered, and if so, grabs that value. If not, ${Name} is used instead.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;And just in case someone has 'Internal' for ${Name} but tries to skip answering ${Call_In_Name}, you can put this condition in the &lt;EM&gt;required&lt;/EM&gt; column for ${Call_In_Name}:&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;if(${Name}='Internal')&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;(note, conditionally required questions apparently don't work in web forms)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;With this setup, the textbox will &lt;EM&gt;always&lt;/EM&gt; equal the ${Call_in_Name} as long as that question is answered. If instead you want to use ${Name} all the time unless A) it's 'Internal' or &lt;SPAN style="text-decoration: underline;"&gt;B) the user wants to &lt;EM&gt;optionally&lt;/EM&gt; override it&lt;/SPAN&gt;, you'll need to do that with at least another question and some additional statements.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 05 Nov 2018 21:41:41 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-survey123-questions/if-statement-and-add-data-to-field/m-p/807770#M12505</guid>
      <dc:creator>NickDierks1</dc:creator>
      <dc:date>2018-11-05T21:41:41Z</dc:date>
    </item>
    <item>
      <title>Re: If statement and add data to field</title>
      <link>https://community.esri.com/t5/arcgis-survey123-questions/if-statement-and-add-data-to-field/m-p/807771#M12506</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;To provide some info to your response:&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;There will be no situations where&amp;nbsp;&lt;SPAN style="display: inline !important; float: none; background-color: transparent; color: #3d3d3d; font-family: arial,helvetica,'helvetica neue',verdana,sans-serif; font-size: 15px; font-style: normal; font-variant: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: left; text-decoration: none; text-indent: 0px; text-transform: none; -webkit-text-stroke-width: 0px; white-space: normal; word-spacing: 0px;"&gt;${Call_In_Name} is selected, but you still want to use ${Name} instead&lt;/SPAN&gt;&lt;/LI&gt;&lt;LI&gt;Using the following method:&amp;nbsp;&lt;SPAN style="text-align: left; color: #3d3d3d; text-transform: none; text-indent: 0px; letter-spacing: normal; font-family: arial,helvetica,'helvetica neue',verdana,sans-serif; font-size: 15px; font-style: normal; font-variant: normal; text-decoration: none; word-spacing: 0px; display: inline !important; white-space: normal; orphans: 2; float: none; -webkit-text-stroke-width: 0px; background-color: transparent;"&gt;if(string-length(${Call_In_Name})&amp;gt;0, ${Call_In_Name}, ${Name}) doesn't seem to overwrite the data already in the textbox (which would be the username)&lt;/SPAN&gt;&lt;/LI&gt;&lt;LI&gt;&lt;SPAN style="font-family: arial,helvetica,'helvetica neue',verdana,sans-serif;"&gt;The select one question will be hidden to all users except to myself (admin account). Will using this approach and relevant criteria cause the fields to be blank?&lt;/SPAN&gt;&lt;/LI&gt;&lt;LI&gt;&lt;SPAN style="font-family: arial,helvetica,'helvetica neue',verdana,sans-serif;"&gt;Yes name should be used all the time unless I (admin) wants to override but not capture my AGOL login info and I then see the select one question and override the username&lt;/SPAN&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: arial,helvetica,'helvetica neue',verdana,sans-serif;"&gt;The workflow is the following:&lt;/SPAN&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;&lt;SPAN style="font-family: arial,helvetica,'helvetica neue',verdana,sans-serif;"&gt;staff member submits a request using the survey&lt;/SPAN&gt;&lt;/LI&gt;&lt;LI&gt;&lt;SPAN style="font-family: arial,helvetica,'helvetica neue',verdana,sans-serif;"&gt;the process continues through to be dispatched and work completed. A second survey is employed to edit and dispatch crews&lt;/SPAN&gt;&lt;/LI&gt;&lt;LI&gt;&lt;SPAN style="font-family: arial,helvetica,'helvetica neue',verdana,sans-serif;"&gt;But if a staff member doesn't use the survey and calls me, I want to be able to add in the request on their behalf&lt;/SPAN&gt;&lt;/LI&gt;&lt;LI&gt;&lt;SPAN style="font-family: arial,helvetica,'helvetica neue',verdana,sans-serif;"&gt;This creates the need for a workaround so that my AGOL username isn't shown in the data&lt;/SPAN&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 05 Nov 2018 22:23:42 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-survey123-questions/if-statement-and-add-data-to-field/m-p/807771#M12506</guid>
      <dc:creator>joerodmey</dc:creator>
      <dc:date>2018-11-05T22:23:42Z</dc:date>
    </item>
    <item>
      <title>Re: If statement and add data to field</title>
      <link>https://community.esri.com/t5/arcgis-survey123-questions/if-statement-and-add-data-to-field/m-p/807772#M12507</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;In that use case, your initial if/then statement should work just fine (I'm assuming your username is 'Internal'). Why is there anything to overwrite in the textbox? It should start blank, and populate only via the if/then calculation:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;TABLE class="j-table jiveBorder" style="border: 1px solid #c6c6c6; width: 95.614%;"&gt;&lt;THEAD&gt;&lt;TR style="background-color: #efefef; height: 25px;"&gt;&lt;TH style="width: 16%; height: 25px;"&gt;name&lt;/TH&gt;&lt;TH style="width: 14%; height: 25px;"&gt;relevant&lt;/TH&gt;&lt;TH style="width: 32.8349%; height: 25px;"&gt;calculation&lt;/TH&gt;&lt;/TR&gt;&lt;/THEAD&gt;&lt;TBODY&gt;&lt;TR style="height: 25px;"&gt;&lt;TD style="width: 16%; height: 25px;"&gt;Name&lt;/TD&gt;&lt;TD style="width: 14%; height: 25px;"&gt;&lt;/TD&gt;&lt;TD style="width: 32.8349%; height: 25px;"&gt;property('username')&lt;/TD&gt;&lt;/TR&gt;&lt;TR style="height: 25px;"&gt;&lt;TD style="width: 16%; height: 25px;"&gt;Call_In_Name&lt;/TD&gt;&lt;TD style="width: 14%; height: 25px;"&gt;${Name}='Internal'&lt;/TD&gt;&lt;TD style="width: 32.8349%; height: 25px;"&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR style="height: 51px;"&gt;&lt;TD style="width: 16%; height: 51px;"&gt;[Textbox]&lt;/TD&gt;&lt;TD style="width: 14%; height: 51px;"&gt;&lt;/TD&gt;&lt;TD style="width: 32.8349%; height: 51px;"&gt;if(${Name}='Internal', ${Call_In_Name}, ${Name})&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Are you trying to recalculate ${Name}, or do you have something set up in the &lt;EM&gt;default&lt;/EM&gt; column for the textbox question? Are you able to share your csv file?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Incidentally, you could also use the &lt;EM&gt;coalesce()&lt;/EM&gt; function and get rid of the ${Name} line:&lt;/P&gt;&lt;TABLE class="j-table jiveBorder" style="border: 1px solid #c6c6c6; width: 95.614%;"&gt;&lt;THEAD&gt;&lt;TR style="background-color: #efefef; height: 25px;"&gt;&lt;TH style="width: 16%; height: 25px;"&gt;name&lt;/TH&gt;&lt;TH style="width: 14%; height: 25px;"&gt;relevant&lt;/TH&gt;&lt;TH style="width: 32.8349%; height: 25px;"&gt;calculation&lt;/TH&gt;&lt;/TR&gt;&lt;/THEAD&gt;&lt;TBODY&gt;&lt;TR style="height: 25px;"&gt;&lt;TD style="width: 16%; height: 25px;"&gt;Call_In_Name&lt;/TD&gt;&lt;TD style="width: 14%; height: 25px;"&gt;property('username')='Internal'&lt;/TD&gt;&lt;TD style="width: 32.8349%; height: 25px;"&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR style="height: 51px;"&gt;&lt;TD style="width: 16%; height: 51px;"&gt;[Textbox]&lt;/TD&gt;&lt;TD style="width: 14%; height: 51px;"&gt;&lt;/TD&gt;&lt;TD style="width: 32.8349%; height: 51px;"&gt;coalesce(${Call_In_Name}, property('username'))&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;This will always input the AGOL username unless there's an answer selected in ${Call_In_Name}.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 05 Nov 2018 22:59:23 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-survey123-questions/if-statement-and-add-data-to-field/m-p/807772#M12507</guid>
      <dc:creator>NickDierks1</dc:creator>
      <dc:date>2018-11-05T22:59:23Z</dc:date>
    </item>
    <item>
      <title>Re: If statement and add data to field</title>
      <link>https://community.esri.com/t5/arcgis-survey123-questions/if-statement-and-add-data-to-field/m-p/807773#M12508</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&amp;nbsp;That's perfect thanks!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The&amp;nbsp;&lt;SPAN style="display: inline !important; float: none; background-color: transparent; color: #3d3d3d; font-family: arial,helvetica,'helvetica neue',verdana,sans-serif; font-size: 14px; font-style: normal; font-variant: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: left; text-decoration: none; text-indent: 0px; text-transform: none; -webkit-text-stroke-width: 0px; white-space: normal; word-spacing: 0px;"&gt;property('username')='Internal'&lt;/SPAN&gt; formula is giving me an error.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Also with&amp;nbsp;${Name}='Internal' as the relevant field, when a user logins in they don't see the fields, which is great. But when they submit data it doesn't grab their username or email from my pulldata function.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Another question though. Can you put an if on pulldata()? I want to check if the user is me (the internal account), if true then grab the email from a csv file I have as it contains emails for all users...since I can't pull from the AGOL account as it would pull my email and not the user's email.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 06 Nov 2018 16:35:02 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-survey123-questions/if-statement-and-add-data-to-field/m-p/807773#M12508</guid>
      <dc:creator>joerodmey</dc:creator>
      <dc:date>2018-11-06T16:35:02Z</dc:date>
    </item>
    <item>
      <title>Re: If statement and add data to field</title>
      <link>https://community.esri.com/t5/arcgis-survey123-questions/if-statement-and-add-data-to-field/m-p/807774#M12509</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I'm not sure what's going on, then--the formulas are working fine in my test so far (see attached xlsx form). Is your username actually 'Internal'? Because what's in those quotes needs to match your username exactly for that formula to work.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;As for the pulldata(), yes, you can use that as a result in an if/then statement or even in the coalesce() function. You could follow this example and put it where you like: &lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;pulldata('ContactList', 'Email', 'UserName', property('username'))&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The survey I attached uses two of these pulldata() functions within a coalesce() function, pulling the email of either the logged in user &lt;EM&gt;or&lt;/EM&gt; the user selected in ${Call_In_Name}. Try it out, and make sure to save the attached ContactList.csv to the media folder to see it in action. Note that for this to work, the Call_In_Name choices have to match the other usernames exactly, including being case sensitive.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If you're still having trouble, try sharing your xlsx form (my email is in my profile if you don't want to attach your survey here). It's possible there's a typo in some formula or other that's throwing things off.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 06 Nov 2018 18:41:53 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-survey123-questions/if-statement-and-add-data-to-field/m-p/807774#M12509</guid>
      <dc:creator>NickDierks1</dc:creator>
      <dc:date>2018-11-06T18:41:53Z</dc:date>
    </item>
    <item>
      <title>Re: If statement and add data to field</title>
      <link>https://community.esri.com/t5/arcgis-survey123-questions/if-statement-and-add-data-to-field/m-p/807775#M12510</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Still not working. Email sent containing xlsx&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 06 Nov 2018 19:46:06 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-survey123-questions/if-statement-and-add-data-to-field/m-p/807775#M12510</guid>
      <dc:creator>joerodmey</dc:creator>
      <dc:date>2018-11-06T19:46:06Z</dc:date>
    </item>
  </channel>
</rss>

