Tying to setup an Expression in Choice control when current user is equals to the Name on the Approver field. However for some reason it does not work. am I doing it incorrectly?
Then Approver field is (First name and Last name, i.e John Doe)
Hoping for your response and much appreciated.
Thank you,
Antonio
Page 1 / 1
Hi @aorellano,
I see a couple of issues here.
Firstly, the current user common reference returns a claims-based identity string (i:0#.w|domain\user), so it will never equal your approver control.
Secondly, The if function (fn-if) takes three parameters, and you only have one. You should replace this with the equals inline function fn-equals(first parameter, second parameter), or, as you are dealing with a claims identity, you may want to use contains (fn-Contains(string value1, string value2)).
Hi Simon,
Thank you for your response, much appreciated. I’ll try the Contains function and see if that works. I thought the “Display Name” parameter is the actual First name and Last Name of current user. How about if combine the UserProfileLookup where “Preferred Name” show the FirstName and Lastname of the account. can this works?
Thank you.
Antonio
Hi @aorellano,
Using the userProfileLookup could help you match the approver with the current user. I also suggest you use a formatting rule rather than configure the formula in the control. When using a function in the control configuration, you cannot reference other controls, but you can when using a rule.
Hi Simon,
I used the formatting rule and that seems to work. It disabled it when the value in the other field is not equals to the current user.