Tue Dec 07, 2021 6:01 am
Login Register Lost Password? Contact Us


JSON Array DataSet

Comments and questions related to the Enterprise Control Language

Mon Oct 02, 2017 6:22 am Change Time Zone

How do I read "days" below?

Code: Select all
{
"season":"winter",
"email":[{"home":"test@test.com"}],
"days":["monday","tuesday"]
}


Code: Select all
schemaEmail := RECORD
   STRING emails {XPATH('home')};
END;
schemaRoot := RECORD
  STRING season {XPATH('season')};
  DATASET(schemaEmail) email{XPATH('email')};
  ???????;
END;

a := DATASET('~::data.json',schemaRoot);


What does the ECL look like for "days"?
househippo
 
Posts: 18
Joined: Sun Nov 03, 2013 9:32 pm

Mon Oct 02, 2017 12:18 pm Change Time Zone

What about this?

Code: Select all
  SET OF STRING days{XPATH('days')};
Tony Kirk
 
Posts: 17
Joined: Thu Jun 23, 2011 5:01 pm

Mon Oct 02, 2017 5:43 pm Change Time Zone

Tony, above solution works great thank you.
househippo
 
Posts: 18
Joined: Sun Nov 03, 2013 9:32 pm


Return to ECL

Who is online

Users browsing this forum: Bing [Bot] and 1 guest

cron