Hi,
I've been trying to get a part of my code to work for days for my Power App but I can't quite get it down. I will provide the vision I have in mind along with the attempts I've tried so you can get a more clear idea as to what my objective is:
I have 2 sharepoint lists connected to my powerapp. One SP list is called DOA and has columns that include Role (choice column) Incumbent and Delegate (person columns) and Active Incumbent (Yes/No column). My other SP list called CVAA is the one I'm using for my form in my powerapps. It has a datacard called Privacy/ATIP Approval which is a person dropdown that displays emails. I want my code to work as the following: it will first check the DOA list to find a row with the Privacy/ATIP Approval choice selected as the Role. Then, it will check to see if there is an Active Incumbent. If the value of Active Incumbent is Yes, I would like the Incumbent's email in that row to be displayed as the default value of that dropdown Privacy/ATIP Approval datacard. If Active Incumbent's value is No, I would like the email 123@gmail.com to be displayed as the default value for the dropdown datacard. I have done multiple attempts and I will paste them below so you can get an idea of what I'm trying to go for (I believe I'm mainly struggling with the syntax):
If(
'DOA'.Role.Value = "Privacy/ATIP Director" && 'DOA'.'Active Incumbent'.Value = true,
'DOA'.Incumbent.Email,
"joshua.john@catsa.gc.ca"
)
If(
LookUp('DOA', Role.Value = "Privacy/ATIP Director").'Active Incumbent',
LookUp('DOA', Role.Value = "Privacy/ATIP Director").Incumbent.Email,
"joshua.john@catsa.gc.ca"
)
I get several errors with these attempts and I'm struggling as I'm sure it's a very small problem somewhere that's causing everything to not work. Please let me know if there is any other information you need I really don't know what to do. Any help/advice is greatly appreciated!