Skip to main content

Notifications

Power Apps - Microsoft Dataverse
Unanswered

Formula Column Data Type Choice - nested if

(0) ShareShare
ReportReport
Posted on by 2
I have a formula column of data type choice. If I write a simple condition everything works. For example:
 
If(Name = "Test",
    Unterlagenstatus.'liegt vor',
    Unterlagenstatus.'liegt vor'
)
 
As soon as I add a second condition I get an error message:
 
If(Name = "Test",
    Unterlagenstatus.'liegt vor',
    If(Name = "Test",
        Unterlagenstatus.'liegt vor',
        Unterlagenstatus.'liegt vor'
    )
)
 
Error: The operation cannot be performed on multiple Option Sets. Please use single Option Set as result type.
 
If I convert it as follows, the error doesn't occur.
 
If(Name = "Test",
    If(Name = "Test",
        Unterlagenstatus.'liegt vor',
        Unterlagenstatus.'liegt vor'
    ),
    Unterlagenstatus.'liegt vor'
)
 
Can someone explain to me what I'm doing wrong? Or is this a system error?
 
  • AS-01110123-0 Profile Picture
    AS-01110123-0 2 on at
    Formula Column Data Type Choice - nested if
    I just ran into the same issue, and changing to the format of "if" suggested by Shashank Bhide worked for me with a Choice.
     
    I think the issue with the nested "if"s is that the return value of the inner if is a Yes/No - so the return value is then a mix of your Choice and Yes/No, rather than always your Choice.
  • TTPlayer Profile Picture
    TTPlayer 2 on at
    Formula Column Data Type Choice - nested if
    Thank you for your reply. I managed to create my formula correctly in another way. 
    But I still don't understand the problem. Why doesn't the above example work?
     
    The following variant works. If I use choices instead of text, I get the error above. Why?
     
    If(Name = "Test",
        "A",
        If(Name1 = "Test",
            "B",
            "C"
        )
    )
  • Shashank Bhide Profile Picture
    Shashank Bhide 932 on at
    Formula Column Data Type Choice - nested if
    have you tried using switch? your second if condition doesn't seem to fit in the way "If" works in powerapps which is just a sequece of condition1->result1, condition2->result2
     
     

    If( Condition1, ThenResult1 [, Condition2, ThenResult2, ... [ , DefaultResult ] ] )

     

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Microsoft Kickstarter Events…

Register for Microsoft Kickstarter Events…

Announcing Our 2025 Season 1 Super Users!

A new season of Super Users has arrived, and we are so grateful for the daily…

Announcing Forum Attachment Improvements!

We're excited to announce that attachments for replies in forums and improved…

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 145,636

#2
RandyHayes Profile Picture

RandyHayes 76,287

#3
Pstork1 Profile Picture

Pstork1 64,942

Leaderboard

Featured topics