working with the record as a group item

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

working with the record as a group item

Post by AriSilva »

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: 2401
Joined: May 5th, 2014, 12:49 pm
Location: Washington DC

Re: working with the record as a group item

Post by josh »

Unfortunately there is no way to do that. It would be very useful though.
AriSilva
Posts: 618
Joined: July 22nd, 2016, 3:55 pm

Re: working with the record as a group item

Post by AriSilva »

Could you "move" that to feature requests, then?
Best
Ari
Gregory Martin
Posts: 1851
Joined: December 5th, 2011, 11:27 pm
Location: Washington, DC

Re: working with the record as a group item

Post by Gregory Martin »

Try this, it might give you want you want:
write("%s", itemlist(PERSON_RECORD));
htuser
Posts: 639
Joined: December 19th, 2011, 6:26 pm
Location: Silver Spring Area, MD, USA

Re: working with the record as a group item

Post by htuser »

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,
G.VOLNY, a CSProuser from Haiti, since 2004
Gregory Martin
Posts: 1851
Joined: December 5th, 2011, 11:27 pm
Location: Washington, DC

Re: working with the record as a group item

Post by Gregory Martin »

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: 639
Joined: December 19th, 2011, 6:26 pm
Location: Silver Spring Area, MD, USA

Re: working with the record as a group item

Post by htuser »

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,
G.VOLNY, a CSProuser from Haiti, since 2004
Post Reply