I am trying to get a dropdown with all the disciplines that are available for a particular user for a particular project. I am unable to do so. Tried using Filter and Lookup but they don't seem to fulfill my need.
Attached below is the SharePoint list which is the database for my app.
and this is where (refer the screenshot below) I want both the discipline names to be visible (CSA and Instrumentation) in the dropdown. The user should have the flexibility to select either of the two disciplines.
Based on this selection, my gallery data gets filtered.
Thanks in advance.
Solved! Go to Solution.
Dangers of using Choice columns.
LookUp(
AddColumns(
Filter(
'Estimation Tool- Project List',
'Project Code'=PcodeBOX_2.Selected.'Project Code' &&
'Project User'.Email = User().Email)).'Discipline Name'
),
"DisiplineName",
'Discipline Name'.Value
)
).DisiplineName
If you must for SharePoint interface, then use them, otherwise do the Choices in Power Apps.
Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.
Visit my blog Practical Power Apps
Hi @Aryarane ,
You have not included any code for either of the drop-downs and you have Delegation warnings shown on them, but if the Items of the first drop-down was
Sort(
Distinct(
'Estimation Tool- Project List',
'Project Code'
),
Result
)
the Items of the second one would be
Sort(
Filter(
'Estimation Tool- Project List',
'Project Code' = YourFirstDDName.Selected.Result
).'Disipline Name',
'Disipline Name'
)
I have added a Sort to both to keep them in order.
Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.
Visit my blog Practical Power Apps
Hi Warren,
Thanks for your prompt response.
This is the formula for the items in Project Code:
Filter('Estimation Tool- Project List',Status.Value="Approved",'Project User'.Email= User().Email)
and the Discipline name dropdown is still throwing an error.
The error says: Sort has an invalid expression. Cannot sort on the expression type.
I don't have much information to work on here including not knowing what type of field 'Discipline Name' is or the name of your first drop-down. I only posed examples of a possible structure, which you have now confirmed is not correct. Assuming both 'Project Code' and 'Discipline Name' are Single Lines of Text and you are displaying the field 'Project Code' in the first drop-down, the Items of the second drop-down would be
Sort(
Filter(
'Estimation Tool- Project List',
'Project Code' = YourFirstDDName.Selected.'Project Code'
).'Disipline Name',
'Disipline Name'
)
The code is valid providing the field types are as I have assumed.
Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.
Visit my blog Practical Power Apps
Hi Warren,
Apologies for not giving you the complete picture.
The first dropdown's name (Project Code) is: PcodeBOX_2
In SharePoint list it is: Single line of text
In it's items property:
Filter('Estimation Tool- Project List',Status.Value="Approved",'Project User'.Email= User().Email)
The next text input's name (Project Name) is: Pnamesubmit_4
In SharePoint list it is: Single line of text
Text property of the text input is:
PcodeBOX_2.Selected.Title
Then comes the discipline Name dropdown. The name is: drpdwnDiscipline
In SharePoint list it is: Choice
the items property is:
LookUp('Estimation Tool- Project List',And('Project Code'=PcodeBOX_2.Selected.'Project Code','Project User'.Email=User().Email)).'Discipline Name'
Screenshot from the SP list:
Hope I have not missed out on any other vital information.
Thank you in advance.
Dangers of using Choice columns.
LookUp(
AddColumns(
Filter(
'Estimation Tool- Project List',
'Project Code'=PcodeBOX_2.Selected.'Project Code' &&
'Project User'.Email = User().Email)).'Discipline Name'
),
"DisiplineName",
'Discipline Name'.Value
)
).DisiplineName
If you must for SharePoint interface, then use them, otherwise do the Choices in Power Apps.
Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.
Visit my blog Practical Power Apps
Hi Warren,
Seems to be working fine. Haven't used lookup in the formula though.
AddColumns(
Filter(
'Estimation Tool- Project List',
'Project Code' = PcodeBOX_2.Selected.'Project Code',
'Project User'.Email = User().Email
).'Discipline Name',
"DisciplineName",
'Discipline Name'.Value
)
But, now, seem to be facing an issue with the Project Code box, I am not getting distinct project numbers in the project code combo box.
Filter(
'Estimation Tool- Project List',
Status.Value = "Approved",
'Project User'.Email = User().Email
)
I think the above doesn't work because of the Delegation issue
Thanks Warren! Appreciate ur help!
Lookup was in your formula - I just used the AddColumns to get the choice field value to Text. I am not sure how the second part is related as it uses none of the values from the first (and does not contain any Distinct filter)