Pulldata from multiple lines

807
7
05-08-2018 10:40 AM
RCECMapping
New Contributor

Hello,

I'm trying to use pulldata in a way I'm not sure it can be used.

In this instance, I'm trying to pull three rows from the table based on a single attribute.

Background - pull info on transformers installed in a location by map number. Each transformer has unique info on table, but there may be more than one transformer at a given map number.

So if the table has three transformers consecutively in rows, but they have the same map number, can I get Survey123 to pull each line into the form.

Thanks

0 Kudos
7 Replies
JamesTedrick
Esri Esteemed Contributor

Hi,

Pulldata can only be used to retrieve one row at a time from a CSV file.  In you scenario, how would the 3 rows be managed?  Would they populate 3 repeats?  Would they serve as a choice list for a question like 'which transformer?'

0 Kudos
RCECMapping
New Contributor

Our linemen need to know what transformers are installed at a location. Sometimes a location has more than one transformer.

I know pulldata can only pull one row, but could it pull one row, then the next field pulls the next row with the same location id?

Maybe I just need to rework the data instead.

0 Kudos
AlexGerrish1
New Contributor III

James,

I have a similar question about working around this multiple-line problem.

My inspection survey is assigned with a Sample Suite number that determines the number and type of samples that need to be taken as part of a survey. A specific Sample Suite can require multiple kinds of bottles that need to be collected. The pulldata table looks like this:

Sample SuiteBottles Required
12 AHDPE 250 ml, Preserved (HNO3), Filtered
12 ABoston 1 Ltr, Preserved (H2SO4), Unfiltered
142 B

HDPE 250 ml, Preserved (HNO3), Filtered

142 BHDPE 500 ml, Preserved (HNO3), Unfiltered
142 B

HDPE 500 ml, Unpreserved, Unfiltered

142 B

Vials 40 ml, Preserved (HCL), Unfiltered

1827 TXA

Boston 1 Ltr, Preserved (H2SO4), Unfiltered

I just need a way to display these multiple lines to the user to show them what kind of bottles they need to collect given a certain sample suite number. These values don't have to persist with the record.

I was able to concatenate the Bottles Required per Sample Suite:

Sample SuiteBottles Required
12 A

HDPE 250 ml, Preserved (HNO3), Filtered

Boston 1 Ltr, Preserved (H2SO4), Unfiltered

142 B

HDPE 250 ml, Preserved (HNO3), Filtered

HDPE 500 ml, Preserved (HNO3), Unfiltered

HDPE 500 ml, Unpreserved, Unfiltered

Vials 40 ml, Preserved (HCL), Unfiltered

1827 TXA

Boston 1 Ltr, Preserved (H2SO4), Unfiltered

but the carriage returns don't translate back to the survey and if I concatenate them all in the same line, the format is messy.

Anything I should try?

0 Kudos
JamesTedrick
Esri Esteemed Contributor

A new line (\n) escape character should work to create a newline (I'm using a note question as you're displaying information).  Aside from that, an HTML line break (<br />) tag should work as well.

0 Kudos
AlexGerrish1
New Contributor III

I still can't seem to get the multiple lines formatted right.

I replaced the commas with dashes (I noticed the pulldata stops parsing at a comma) and added \n to the records in Bottles Required field. 

Sample SuiteBottles Required
12 A

HDPE 250 ml--Preserved (HNO3)--Filtered\nBoston 1 Ltr--Preserved (H2SO4)--Unfiltered

142 B

HDPE 250 ml--Preserved (HNO3)--Filtered\nHDPE 500 ml--Preserved (HNO3)--Unfiltered\nHDPE 500 ml--Unpreserved--Unfiltered\nVials 40 ml--Preserved (HCL)--Unfiltered

1827 TXA

Boston 1 Ltr--Preserved (H2SO4)--Unfiltered

The result pulled for '12 A' is:

HDPE 250 ml--Preserved (HNO3)--Filtered\nBoston 1 Ltr, Preserved (H2SO4), Unfiltered

I also tried adding \n to the records with the line breaks in the cells (the second table in my previous comment) but pulldata also stops parsing at the line break regardless of the escape character.

0 Kudos
JamesTedrick
Esri Esteemed Contributor

Hi Alex,

I may have misread this slightly- I was able to generate multiple lines by reading two values and using the concat() function to join them.  In the situation you are doing I would try the HTML tag approach.

AlexGerrish1
New Contributor III

That's brilliant.

0 Kudos