Copy link to clipboard
Copied
Hi all, is there a way I can get an image or text to display backed on the score in a text field? I have the text field that sums other scores in the assessment sheet. I would like a non-editable text to show based on this overall score i.e. score 0-49.99 shows 'fail', 50-60 shows 'Sat', 60-70 shows 'good' etc.
Thanks 🙏
Copy link to clipboard
Copied
Sure. You can use something like this as the custom calculation script of that field (let's say the other field is called "Score"):
var score = Number(this.getField("Score").valueAsString);
if (score<50) event.value = "Fail";
else if (score<=60) event.value = "Sat";
else if (score<=70) event.value = "Good";
// etc.
[edited: small mistake in the code fixed]
Copy link to clipboard
Copied
Thanks Try67. When I put that in, it says there is a ) missing after argument list 1. I can see there is an opening ( but not sure where to put the closing one.
Copy link to clipboard
Copied
I fixed it, just put it where I thought it would fit to close the argument. Works perfectly, thank you so much 👍
Copy link to clipboard
Copied
Thanks, I fixed it now. And glad to hear it's working well for you!
Copy link to clipboard
Copied
No problems. Do you know by chance how to give minutes between 2 times? I've searched and tried to modify other scripts but cannot get it to work. Eg. 0800 (start) 0847 (end) gives 47 mins. I need it in 24hr and date does not matter.
Copy link to clipboard
Copied
It would be better to start a new thread for a new question... Also, this subject was discussed here many times in the past. Did you try searching the forum first for past questions?
Copy link to clipboard
Copied
Yeah I did search and tried a few suggestions but couldnt get it to work, I might be jsut too unfamiliar with what the code is to fault find. I'll see if I can get somone on Fiverr to do it for me. Thanks
Copy link to clipboard
Copied
If you're interested in someone writing this script for you, that's something I could do for you (for a small fee). You can contact me privately via a PM to discuss it further.