Apr 11 2023 09:12 AM - edited Apr 11 2023 09:13 AM
Hello
I am using classic view in SharePoint Online and created calculated column and added formula as mentioned below
=IF([Countdown]>=271,"<IMG src='/test/Images/Valid.GIF"&"'/>",IF([Countdown]>0,"<IMG src='/test/Images/Expiring.GIF"&"'/>","<IMG src='/test/Images/Invalid.GIF"&"'/>"))
It is throwing error "The formula contains a syntax error or is not supported". I know this can be done easily in Modern View , but I have to implement in classic view. I am not able to figure out where is the issue.
Apr 12 2023 12:47 AM
@Avi65 HTML is no longer supported in calculated column formula in SharePoint online.
Some users have added HTML markup or script elements to calculated fields. This is an undocumented use of the feature, and we will block the execution of custom markup in calculated fields in SharePoint Online from June 13, 2017 onwards.
Documentation: Handling HTML markup in SharePoint calculated fields
You may need to use client side rendering (CSR) / JSLink for you requirements in classic experience.
Please click Mark as Best Response & Like if my post helped you to solve your issue. This will help others to find the correct solution easily. It also closes the item. If the post was useful in other ways, please consider giving it Like.
For SharePoint/Power Platform blogs, visit: Ganesh Sanap Blogs
Apr 12 2023 01:17 AM
Apr 12 2023 02:00 AM
@Avi65 Do you have access to content editor or script editor web part? You can use those as well to inject custom JavaScript on classic pages.
Also, check below threads which might help you:
Please click Mark as Best Response & Like if my post helped you to solve your issue. This will help others to find the correct solution easily. It also closes the item. If the post was useful in other ways, please consider giving it Like.
For SharePoint/Power Platform blogs, visit: Ganesh Sanap Blogs
Apr 12 2023 02:48 AM
Apr 12 2023 03:01 AM
@Avi65 Check below Microsoft official documentation which has PowerShell command example for enabling it:
Allow or prevent custom script
Please click Mark as Best Response & Like if my post helped you to solve your issue. This will help others to find the correct solution easily. It also closes the item. If the post was useful in other ways, please consider giving it Like.
For SharePoint/Power Platform blogs, visit: Ganesh Sanap Blogs
Apr 12 2023 08:58 AM
Apr 13 2023 01:53 AM
Solution@Avi65 Yes, it can be enabled at either tenant level or at site collection (site) level.
It is not supported for SharePoint sub-site level. So, enable it at site collection level and you should be able to use it at sub-site level.
Please click Mark as Best Response & Like if my post helped you to solve your issue. This will help others to find the correct solution easily. It also closes the item. If the post was useful in other ways, please consider giving it Like.
For SharePoint/Power Platform blogs, visit: Ganesh Sanap Blogs
Apr 13 2023 01:53 AM
Solution@Avi65 Yes, it can be enabled at either tenant level or at site collection (site) level.
It is not supported for SharePoint sub-site level. So, enable it at site collection level and you should be able to use it at sub-site level.
Please click Mark as Best Response & Like if my post helped you to solve your issue. This will help others to find the correct solution easily. It also closes the item. If the post was useful in other ways, please consider giving it Like.
For SharePoint/Power Platform blogs, visit: Ganesh Sanap Blogs