Toggle navigation
Home
▼ Details
Products and pricing
Chart gallery
User stories
Text analytics
CDC NAMCS Library
Blog
Tutorials
Contact
Sign in
Post Editor
← All help posts
View post
Save
When projects are imported from the SPSS file the questions can have a format that looks like this: <img src="/uploads/upload/image/5200/direct/1559861284682-kE_tiHPpF6lXRSw7XCu_Mb8TRHVMpXhnGQ.png" alt="Protobi's Edit format dialog showing a 7-point scale with values 1 through 7. The first value is labeled 'Least valuable 1' and the last value is labeled 'Most valuable 7', demonstrating the default format where numbers appear at the end of labels." style="width: 360px;" class="fr-fic fr-dib"> Placing the numbers in the front instead of the back can make the information more readable and visually appealing. ## 7 point scale There are a few ways to do this, you can either edit the [format](/edit-access/formatting) for any question, or use the console. The following code will move the number to the front, e.g., 'Most Valuable 7' to '7 Most Valuable.' ``` protobi.getDimensions().forEach(function(dim) { var fmt = dim.get('format'); if (fmt) { for (var key in fmt) { var d =fmt[key].slice(-1); if (d==+d) { console.log(fmt[key]); fmt[key] = d + ' ' + fmt[key].slice(0,-1)}} }}) ``` It can be seen in the console of the below project: <img src="/uploads/upload/image/5200/direct/1559861322523-JQy_OIH1IR3o_51n-7iTjf8CRh8lS_ehiA.png" alt="Protobi project interface showing the browser's developer console at the bottom with JavaScript code visible. The main area displays a medical survey project with navigation tabs and a medical-themed illustration with hexagonal icons. The console shows the JavaScript code for moving numbers to the front of scale labels." style="width: 600px;" class="fr-fic fr-dib"> ## 10 point scale The following code works for 10 point scales because it will move two digit numbers to the front, e.g., 'Excellent 10' to '10 Excellent.' Similar to the code above for 7 point scales, put this code in your console. ``` protobi.getDimensions().forEach(function(dim) { var fmt = dim.get('format'); if (fmt) { for (var key in fmt) { var d =fmt[key].slice(-2); if (d==+d) { console.log(fmt[key]); fmt[key] = d + ' ' + fmt[key].slice(0,-2)}} }}) ``` The two sets of code above are examples of how JavaScript can be utilized to efficiently modify your Protobi project.
Publishing
Date
Status
Published
Draft
Slug
edit
Content
Thumbnail
Categories
Manage
New to Protobi?
Charts
Making Changes
Intermediate topics for editors
Frequently Asked Questions
SERMO Topics
Tutorial Pages
Internal Docs
Data Processing
Videos
Obsolete
GSG Admin
SERMO Admin
GSG Topics
How to...
Basics for viewers
Basics for editors
For project admins
Advanced topics
Assessments
Articles (in-progress)
New and updated articles
Process data in Protobi
superseded
Text open-end questions
Troubleshooting
Tracking studies
Organizing the view
API References
Tools
AI Database
Checking AI...
Convert to MD
Danger zone
Delete