Reputation: 45
The question i have is am trying to make an IF statement for a default item in a dropdwon menu.
In Items:
Table(
{
Text: "Renouvellement",
Val: 1
},
{
Text: "Nouveau Patient",
Val: 2
},
{
Text: "Non Renseigner",
Val: 3
}
)
in Default:
If(
ThisItem.ORD_TYPE_SID2 = 1,
"1",
If(
ThisItem.ORD_TYPE_SID2 = 2,
"2",
If(
ThisItem.ORD_TYPE_SID2 = 3,
"3"
)
)
)
What am trying to do is if the ORD_TYPE_SID is = to 1 or 3, then use the list index 1 or 3. How can i do that? but if i do show value the results is correct
Upvotes: 1
Views: 1542
Reputation: 4375
Check out the PowerApps LookUp() Function. It brings back the first record (or field) in a Table that matches a condition.
Try:
Default
property to:LookUp(
Table(
{
Text: "Renouvellement",
Val: 1
},
{
Text: "Nouveau Patient",
Val: 2
},
{
Text: "Non Renseigner",
Val: 3
}
),
Val = ORD_TYPE_SID2.Selected.Value,
Text
)
Note:
Val
field
ORD_TYPE_SID2
dropdownIllustration:
Upvotes: 1