Appian Community and Appian Academy are being upgraded. From July 24–August 3, the Appian Community will be in read-only mode. During this time, the site will be read-only and user registration will be disabled. We apologize for any inconvenience this may cause, but a more secure, stable, and performant Community experience is coming soon!

The new Appian Community launches August 3, followed by Appian Academy on August 7. During the migration, Appian Community Edition, Appian Academy, Documentation, Certifications, Instructor-led Customer Training, Partner Sales Training & Accreditation, and Forum (for Appian Partners and Customers only) will remain available.

How to parse data from a string, specifically how do I find the index of the first character that's a number?

Certified Senior Developer

So I've got an API integration that returns data in a single string field and I'd like to extract sections of the data to put into separate CDT fields. So the string that's returned will look something like this: "Advil 20 MG/ML Oral Suspension". I'd like to retrieve the data before the number, then everything after including the number. I've posted what I have so far below. What I'm wondering is how do I get the index of the first character that's a number? If I get that, then I can figure out the rest. Thanks!

a!forEach(
  items: rule!NLH_GetPrescriptionDrugs(searchTerm: ri!search).result.body.drugGroup.conceptGroup.conceptProperties,
  expression: a!forEach(
    items: fv!item,
    expression: 'type!{urn:com:appian:types:NLH}NLH_Prescription'(
      rxcui: fv!item.rxcui,
      medication: fv!item.synonym
    )
  )
)

  Discussion posts and replies are publicly visible

Parents Reply Children