Hi,
I am having an issue with my app, I am getting an error " Value โSite Queryโ in field โStatusโ cannot be converted to type 'Enum." I know that this isnโt in the list of allowed values. I thought I could bypass this by adding a valid_if statement for โStatusโ however this only gets past the โValue is invalidโ. I also know this can be solved by adding the option to add values to the enum but I donโt want anyone else to be able to do so.
Is there a way to use USEREMAIL() to allow exclusive enum values depending on the email address the user uses? For example:
My Email has the option of โStartedโ, โCompletedโ and โSite Queryโ.
and other users only have the options of Started and Completed.
I can change status to โQueryโ through the mySQL database and this runs ok on the app, however I canโt set the value through the app which I want supervisors on site to be able to do. Any help would be appreciated.
Kind Regards
Lee
@RezaRaoofi can you give a hand to @Yee_Group?
In the Valid_If you can set the list like IF(USEREMAIL()=โyeegroup@gmail.comโ,{Started,Completed,Site Query},{Started,Completed}). Please remember that this example will work only when they are filling the form. If your user needs to modify the record and you have set the value to โSite Queryโ, they canโt save it because the validation rule is not TRUE.
A comment โ if it is an Enum type, then it has a list of allowed values as part of the type definition. It optionally can enable โAllow Other Valuesโ. If not, the app will not accept any value other than what is in the list.
Valid_If is a way to further refine what is allowed. For example, if an Enum has values A, B, โฆ Z. You cannot give AA as a value unless you enable the โAllow other valuesโ flag. It does not matter if the Valid_If allows it.
One approach for this is using action button(s) to write that value. You can show the Site Query button only for you and others will see only Started or Completed buttons.
@Aleksi_Alkio This is how I tried to resolve the issue, however as @praveen has mentioned, It will not accept the value due to disabling โAllow Other Valuesโ.
My follow on question, is it possible to allow other values using USEREMAIL() or show selected Enum values for general users and the full range of Enum values for one email?
You could use an IF statement in Valid_If likeโฆ IF(USEREMAIL()=โname@email.comโ,{Option1,Option2,โฆOption10},{Option1,Option6,Option7}). Please aware that if you have chosen Option2 with this email address and then other user opens the record, they canโt save it without changing the value first. They canโt save the existing value because itโs not valid.
@Aleksi_Alkio I will try this solution, as the idea behind this is : The user does work, the supervisor can query this back to them and they rectify the problem. So they should have to change it once the problem has been rectifies, I will try this now. thank you.
Youโre welcome
User | Count |
---|---|
41 | |
36 | |
28 | |
23 | |
16 |