Coding Tips 1

Prashant LearnIT
Sep 23, 2022

--

Sometimes you need to convert something like a Choice Value List into a specific integer for a calculation.

For this, I am using a function for such scenarios.

Below you can see an example:

๐˜ง๐˜ถ๐˜ฏ๐˜ค๐˜ต๐˜ช๐˜ฐ๐˜ฏ ๐˜ค๐˜ฐ๐˜ฏ๐˜ท๐˜ฆ๐˜ณ๐˜ต๐˜š๐˜ต๐˜ณ๐˜ช๐˜ฏ๐˜จ๐˜›๐˜ฐ๐˜๐˜ฏ๐˜ต๐˜ฆ๐˜จ๐˜ฆ๐˜ณ(๐˜ช๐˜ฏ๐˜ฑ๐˜ถ๐˜ต) {

๐˜ท๐˜ข๐˜ณ ๐˜ค๐˜ฉ๐˜ฐ๐˜ช๐˜ค๐˜ฆ๐˜ด = {

โ€˜๐˜ญ๐˜ฐ๐˜ธโ€™ : 1,

โ€˜๐˜ฎ๐˜ฆ๐˜ฅ๐˜ช๐˜ถ๐˜ฎโ€™ : 2,

โ€˜๐˜ฉ๐˜ช๐˜จ๐˜ฉโ€™ : 3,

โ€˜โ€™ : โ€˜โ€™

};

๐˜ณ๐˜ฆ๐˜ต๐˜ถ๐˜ณ๐˜ฏ ๐˜ค๐˜ฉ๐˜ฐ๐˜ช๐˜ค๐˜ฆ๐˜ด[๐˜ช๐˜ฏ๐˜ฑ๐˜ถ๐˜ต];

}

--

--

Prashant LearnIT

I would like to share my professional and technical knowledge with everyone. I will provide all new information related to ServiceNow and other technical stuff.