Hi, In xlsforms, i am trying to split a string(barcode) by (;) delimiter. I only found a exp for separate by positions substr(${Barcode2},8,25). Someone knows a expression for this.? Thanks

3184
7
04-12-2017 07:38 AM
PriscilaSamaniego
New Contributor II

Hi, In xlsforms, i am trying to split a string(barcode) by (;) delimiter. I only found a exp for separate by positions substr(${Barcode2},8,25). Someone knows a expression for this.? Thanks

7 Replies
JamesTedrick
Esri Esteemed Contributor

Hi Priscila,

 

There currently isn't a function that can separate text based on a delimiter in the XLSForm specification.   We have given a bit of thought on this, but it will be a while before we approach this with a workaround.

HélèneTouyéras
Occasional Contributor II

Hi James,

Do you have any update on this topic?

Our customers would also need us to use this functionnality, to extract fieldworker's initials from their property('username'). The split would then be on the "." character, and we would chain sustr() and split functions.

Many thanks!

Hélène.

0 Kudos
JamesTedrick
Esri Esteemed Contributor

Hi Hélène,

There is not a function in the XLSForms specification that directly supports this.  That being said, it is possible to use a custom JavaScript function (beta functionality documented in the Early Adopter Community) to create a function to split text like the username.

HélèneTouyéras
Occasional Contributor II

Many thanks for the fast reply! I will look into this function. 

0 Kudos
RonParis
Occasional Contributor

Hi Hélène, did you managed to achieve a workaround using the javascript functionality?

Many thanks

Josh

Alex_at_Exprodat
New Contributor II

@JamesTedrick  How long before the substring-before XLSForms function (from ODK, per W3C XForms standard) is implemented into Survey123 Connect? Since custom JavaScript functions cannot be used in public surveys, this would be very helpful as a split/parse function.

0 Kudos
DavidHines
New Contributor II

@JamesTedrick Do you have a direct link or name of the Custom Java script example that is used to split text from a multiline question?

Thanks