Skip to main content

Notifications

Power Apps - Building Power Apps
Unanswered

Is there a way to replace text with IF or SWITCH

Posted on by

Hello,

 

Is it possible to replace or erased a text field with a condition IF formula?

 

I tried using the following syntax. It does display "Vacant"; however, the source data in SharePoint list still shows the original employee name and not the text Vacant. Is there a way to actually replace the original value with Vacant. 

 

The syntax is used on the text property for Employee.

If(ThisItem.Status = "Vacant","Vacant",ThisItem.Employee)

 

Any help would be greatly appreciated.

Categories:
  • Drrickryp Profile Picture
    Drrickryp 30,510 on at
    Re: Is there a way to replace text with IF or SWITCH

    @punksterz626 

    What control is currently in the Employee card and what type of column is employee?

     

  • punksterz626 Profile Picture
    punksterz626 on at
    Re: Is there a way to replace text with IF or SWITCH

    So after using If(ThisItem.Status = "Vacant","Vacant",ThisItem.Employee) on the update property on the employee data card I am unable to reverse the process. If I change the status to Active and manually change the employee name, the Vacant text remains and won't reflect the new name. I'm not sure why that is.

  • Drrickryp Profile Picture
    Drrickryp 30,510 on at
    Re: Is there a way to replace text with IF or SWITCH

    @punksterz626 

    Ok, then you want to use it as the Update property of your Employee card. Once you Submit the form, the Employee name should change if the status is "Vacant".

  • Drrickryp Profile Picture
    Drrickryp 30,510 on at
    Re: Is there a way to replace text with IF or SWITCH

    @punksterz626 

    Ok, then you want to use it as the Update property of your Employee card. Once you Submit the form, the Employee name should change if the status is "Vacant".

  • punksterz626 Profile Picture
    punksterz626 on at
    Re: Is there a way to replace text with IF or SWITCH

    Correct. I have a form for updating records. The objective is to change the status and auto populate or remove certain data from a field

  • Drrickryp Profile Picture
    Drrickryp 30,510 on at
    Re: Is there a way to replace text with IF or SWITCH

    @punksterz626 

    Please provide the context, are you using it in a form? 

  • punksterz626 Profile Picture
    punksterz626 on at
    Re: Is there a way to replace text with IF or SWITCH

    It works fine on the display but the actual data in my share point list still still shows the original text(the employee name) not the replaced text vacant I want

  • Drrickryp Profile Picture
    Drrickryp 30,510 on at
    Re: Is there a way to replace text with IF or SWITCH

    @punksterz626 

    When I tested your formula in my gallery, it worked fine. 

  • punksterz626 Profile Picture
    punksterz626 on at
    Re: Is there a way to replace text with IF or SWITCH

    Single line text

  • Drrickryp Profile Picture
    Drrickryp 30,510 on at
    Re: Is there a way to replace text with IF or SWITCH

    @punksterz626 

    What type of column is status?

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

November 2024 Newsletter…

November 2024 Community Newsletter…

Community Update Oct 28…

Power Platform Community Update…

Tuesday Tip #7 Community Profile Tips…

Welcome to a brand new series, Tuesday Tips…

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 143,246

#2
RandyHayes Profile Picture

RandyHayes 76,308

#3
Pstork1 Profile Picture

Pstork1 63,884

Leaderboard