
Announcements
In OnStart action of my App I need to check if the user is in a particular AzureAD group and if a DataCardValue is blank, then set a variable to true, false. A screenshot of my code is as follows with a ton of errors. I am not sure what is wrong. (NOTE: I know that I am missing the Id of the AzureAD group, they will be created tomorrow). I need to use these variables to then set some fields to DisplayMode.View and a variable varFormTab in the Edit form to "Hiring Manager". I think the variable varFormTab needs to be "initialized" in the OnStart at the beginning of this code. Any help would be appreciated.
Hi @GoGorilla ,
1)AzureAD.CheckMemberGroupsV2()will return a table , not boolen.
If this user is in this specific group, it will return a table with this group's id.
If this user is not in this specific group, it will return a blank table.
So if you want to justify whether a user is in this specific group, you need to use IsEmpty function.
Formula like this:
IsEmpty(AzureAD.CheckMemberGroupsV2(User().Email,["groupid"]).value)
If you are in this group, it will return false. If you are not in this group, it will return true.
2)Try to modify your formula like this:
If( And( IsEmpty(AzureAD.CheckMemberGroupsV2(User().Email,["groupid"]).value),
IsBlank(EmpTypeDataCardValue8.Selected.Value)
),
Set(varContractHM,true), //user is not in that group and the selectedvalue is blank
Set(varContractHM,true)
);
If( IsEmpty(AzureAD.CheckMemberGroupsV2(User().Email,["groupid"]).value),
Set(varHirMgr,true),Set(varHirMgr,false)
) //if user is not in that group, then the variable will be true
;....//modify others like above
Best regards,