working with the record as a group item

Discussions about editing and cleaning data
Post Reply
AriSilva
Posts: 470
Joined: July 22nd, 2016, 3:55 pm

working with the record as a group item

Post by AriSilva » December 9th, 2019, 10:08 am

Is there a way to refer to the whole contents of a record?
For example, a record type has many variables, and I want to write them all in to a write command, such as
write("%s", person_record_edt);
without having to create a group item, or naming them one by one.
Best
Best
Ari

josh
Posts: 2399
Joined: May 5th, 2014, 12:49 pm
Location: Washington DC

Re: working with the record as a group item

Post by josh » December 9th, 2019, 12:45 pm

Unfortunately there is no way to do that. It would be very useful though.

AriSilva
Posts: 470
Joined: July 22nd, 2016, 3:55 pm

Re: working with the record as a group item

Post by AriSilva » December 10th, 2019, 8:24 am

Could you "move" that to feature requests, then?
Best
Ari

Gregory Martin
Posts: 1418
Joined: December 5th, 2011, 11:27 pm
Location: Washington, DC

Re: working with the record as a group item

Post by Gregory Martin » December 10th, 2019, 8:48 am

Try this, it might give you want you want:
write("%s", itemlist(PERSON_RECORD));

htuser
Posts: 486
Joined: December 19th, 2011, 6:26 pm
Location: HAITI

Re: working with the record as a group item

Post by htuser » December 10th, 2019, 9:21 am

Good news to have a way to write a record in a shorten way. Thanks a lot Greg. However, we would like to know if :
1.- can we have a workaround to write record item label instead of code?
2.- Can we have some basic help for undocumented reserved word?
Thanks in advance,

Gregory Martin
Posts: 1418
Joined: December 5th, 2011, 11:27 pm
Location: Washington, DC

Re: working with the record as a group item

Post by Gregory Martin » December 10th, 2019, 1:50 pm

Itemlist was added a long time ago (4.1 maybe) to simplify what you can now do with %v. For example:
itemlist(A, B, C) = maketext("%v%v%v", A, B, C)
It's convenient to use because it also takes a record name. However, it is not documented because it will likely be removed in a future release.

htuser
Posts: 486
Joined: December 19th, 2011, 6:26 pm
Location: HAITI

Re: working with the record as a group item

Post by htuser » December 10th, 2019, 2:22 pm

Thanks Greg. This explanation is very clear. However what we need is to have a way to write the content of a record, (label, not code) to a report (templated record). So, i think that the itemlist(RECORD) could do the job. But. it seem that there's no way to ouput label...
If questionnaire case is parsed in the CSdb/CSdbe, including valueset as relational table to code (as it's in CSPro2SQL), this will solve this demand.
Best,

Post Reply