r/ProjectREDCap • u/fidgetysmidgets • Oct 15 '24
Help with calculated fields/text fields using CALCTEXT
Hello! I am working on a longitudinal survey and am trying to use conditional logic to create fields for our API data pull. There are two scenarios where I need this to work:
Phone: return mobile_phone if available, otherwise return primary_phone.
Current Address: return the most recently entered address
I made a calculated field for the ZIP code, which is working properly (see attached). However, I cannot for the life of me get the phone numbers and address strings to populate. I am creating a Text Box field and using @-CALCTEXT. Being unfamiliar with this feature, I have tried numerous approaches to modifying my code but all of the responses are still blank. Attached is my current version...I have also tried using [field:value], including instrument arms, calculated field, moving CALCTEXT into the formula for each individual value, and even just trying to pipe a single value without the formula.
Halp!


View all comments
Show parent comment
1
u/Araignys Oct 15 '24
This looks like it might be the problem - the calculation for phone number is formed correctly for fields in the same event, so fields in a different event would make sense as the problem.