Hello,
Not sure if this is question for PowerApp or SharePoint lists.
I have an app, that uses a SharePoint list (Main List) with the following columns:
where Type of Task is 'Choice' column - populated in PowerApp as Dropdown.
Then I have another SharePoint list with columns below with pre-defined values:
So each task type has given assignee ie.
Washing Judy
Cleaning Peter
etc.
What I am trying to do in the App/Main List is when certain 'Type of Tasks' is selected
, the app would also record the Assignee from the other list based on the Task Type.
I have tried playing with Lookup value in the lists and also lookup within PowerApps but cannot get it working.
Please can anyone help.
Kind Regards,
Ivo
@Ajwou ,
That sounds about right.
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.
MVP (Business Applications) Visit my blog Practical Power Apps
I changed the Assignee columns in both lists to TEXT. I suppose I will have to use a different code now?
Would that be only a simple LookUp function now?
LookUp('RFI_IRL-Services','Task Type'= DataCardValue21.Selected.Value,'Assignee Name')
@Ajwou ,
Did you put the code I supplied in the DefaultSelectedItems of the Assignee Combo Box ? If it does not work, please consider going back to text fields for both areas and this will all go away.
Yes, writing back to Person Field. For some reason when I select the Task type, nothing appears in the Assignee ComboBox and when I submit the form, nothing comes through in the Assignee field (Person type)
@Ajwou ,
If you are writing back to a Person field, the code I posted would be a good place to start.
Apologies for the mix-up of Dropdown and ComboBox.
The Update of the DataCard is DataCardValue1.Selected
Hi @Ajwou ,
What do you mean by it doesn't generate any value - in the ComboBox or Parent List ?
If it is not saving, what is the Update of the Data Card . You also described this control as a Drop-down - if it is a Combo Box, forget about the Default - you need this in the DefaultSelectedItems
{
DisplayName:
With(
{
wName:
LookUp(
SecondListName,
TaskType = TypeOfTaskDropdownName.Selected.Value
).'Assignee Name'
},
With(
{
wEmail:
First(
Office365Users.SearchUser(
{
searchTerm: wName,
top: 999
}
)
).Mail
},
{
Assignee:
{
Claims: "i:0#.f|membership|" & Lower(wEmail),
Email: wEmail,
DisplayName: wName,
Picture: "",
Department: "",
JobTitle: ""
}
}
)
)
}
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
Yes, that fixed the issues with the code. I set is as 'Default' parameter for the Assignee ComboBox field, however when I fill in the TypeOfTask it doesn't generate any value - in the ComboBox or Parent List . I have both lists connected to the app.
@Ajwou ,
Please see correction - dangers of free-typing code (was missing field name)
Hi @WarrenBelz ,
I wasn't sure about the right data structure here. The Assignee field doesn't even have to be shown in the app. The aim is to log the details provided from the app, and then based on the selected/recorded 'task' add an assignee from a predefined list.
I have tried the code above and getting the following:
Not sure what I am missing here.
I currently have thh main list Assignee as 'person' type and secondary list as 'text'