web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Apps
Answered

Error in Power Fx?

(0) ShareShare
ReportReport
Posted on by 4
Hi All,
 
I was trying to complete my assignment and got stuck on the last stages of building my Canvas app. Mu Canvas App solution is an Animal Foster Management App and it has three screens:
  • Screen One is SelectShelterScreen: Here we select shelter from the dropdown menu
  • Screen Two is ViewAnimalsScreen: Here we select an animal amongst from the selected shelter, for fostering.
  • Screen Three is AnimalDetailsScreen: Here we display the detail of the animal selected and then I was suppose to insert two Text Input fields to take in user input, but my Power Fx is struggling to capture it right. 
Can you please have a look at it and tell me what's wring with my Power Fx, I have tried Copilot but somehow didn't fix it for me.
 
Below is the Power FX formula for the Button (Button_ClaimFoster) on the third screen: AnimalDetailsScreen. I keep gettin multiple error like:
  • the Text is not recognized,
  • Patch has invalid arguements,
  • IsBlank has invalid arguements, 
  • The type of this argument 'arsm_currentlocation' does not match the expected type 'Text'. Found type 'Error'. arsm is a prefix name of my publisher.
If(
    IsBlank(TextInput_FosterName.Text) || IsBlank(TextInput_FosterLocation.Text),
    Notify("Foster claimer and location are required!", NotificationType.Error),
    Patch(
        Animal_Tables,
        SelectedAnimal,
        {
            'Shelter Status': {Value: "Claimed for Foster"},
            'Foster Claimer': TextInput_FosterName.Text,
            'Current Location': TextInput_FosterLocation.Text
        }
    );
    Notify("Animal successfully claimed for foster!", NotificationType.Success);
    Navigate(ViewAnimalsScreen, ScreenTransition.Fade)
)
Many thanks in Advance
Biniyam
Categories:
I have the same question (0)
  • Suggested answer
    Michael E. Gernaey Profile Picture
    53,960 Moderator on at
     
    Can you do me a favor please and post a picture of the code. My guess is you should see some red squiggles and it helps to identify focus areas if we see them all and all their errors.
     
    Now just looking at what you said. Please note its great you listed the errors, but its a bit of a guess here :-) since I cannot see what is underlined in red, so I am Colomboing it hehe (if you are old like me you'll know that show)
     
    Ok you have
    My guess is  TextInput_FosterLocation.Text is incorrect.
    Is that a Dropdown or Combobox?
     
    I ask because you errors said
    Text is not recognized. I combine that with IsBlank has invalid arguments AND it says you are supposed to set 'Current Location' to a TEXT (aka string(
    Well the only thing you have used 3 times, and that would align as being the trouble maker is
     
    TextInput_FosterLocation.Text
     
    So please let me know what this is, because if its a TextInput, I believe something is wrong. So paste a picture of the code with all the squiggles and let's have you click and highlight the control you are saying is TextInput_FosterLocation.Text.. as I just have a feeling its a drop down or combobox and you need to do .SelectedText or .Selected.Value instead.
     
     
    Below is the Power FX formula for the Button (Button_ClaimFoster) on the third screen: AnimalDetailsScreen. I keep gettin multiple error like:
    • the Text is not recognized,
    • Patch has invalid arguements,
    • IsBlank has invalid arguements, 
    • The type of this argument 'arsm_currentlocation' does not match the expected type 'Text'. Found type 'Error'. arsm is a prefix name of my publisher.
    If(
        IsBlank(TextInput_FosterName.Text) || IsBlank(TextInput_FosterLocation.Text),
        Notify("Foster claimer and location are required!", NotificationType.Error),
        Patch(
            Animal_Tables,
            SelectedAnimal,
            {
                'Shelter Status': {Value: "Claimed for Foster"},
                'Foster Claimer': TextInput_FosterName.Text,
                'Current Location': TextInput_FosterLocation.Text
            }
        );
        Notify("Animal successfully claimed for foster!", NotificationType.Success);
        Navigate(ViewAnimalsScreen, ScreenTransition.Fade)
    )
     
  • Suggested answer
    Almas Mahfooz Profile Picture
    31 on at
     SelectedAnimal,
            {
                'Shelter Status': {Value: "Claimed for Foster"},
                'Foster Claimer': TextInput_FosterName.Text,
                'Current Location': TextInput_FosterLocation.Text
            }
     
    SelectedAnimal
    In ViewAnimalsScreen , what control you are using to display animals? Gallery or Form?
    If you are using Gallery you need to mention GalleryName.Selected
     
    'Shelter Status' seems to be a choice field, so you need to use it in patch like below
     
    Shelter Status: 'Shelter Status (Animal_Tables)'.'Claimed for Foster'
     
    P.S. Please change names as per your columns and tables names.
     
     
    Below is code from my application, working fine.
     
    If(IsBlank(Gallery4.Selected.Comment)|| IsBlank(Gallery4.Selected.AssignedTo),
        Notify("this is to Notify Blank fields",NotificationType.Warning),
    Patch(Tickets,Gallery4.Selected,
    {AdditionalInformation:"this is Add info" , TicketStatus:'TicketStatus (Tickets)'.'In Progress'}
    ))
  • CU04020157-0 Profile Picture
    4 on at
    Thank you Both (Almas & Michael),
     
    My apologies for the delayed response. It's almost morning here in Atlanta, but I am wide awake now.
     
    I took some pictures of my Power Fx formulas for the third screen as explained in my previous post, and also for the second screen, which only seems to work for viewing all the animals in the selected shelter and not for the 'Ready for Foster' ones. 
     
     
    Power Fx for the first screen. It appears to work find:
     
    Items: Shelter_Tables
    Value: ShelterID
     
    OnSelect the Button to confirm the selected shelter and move to the second screen to view the animals
     
    Set(SelectedShelter, Dropdown_Shelters.Selected);
    Navigate(ViewAnimalsScreen)
     
     
     
     
    Power Fx for the second screen. I am using a gallery (vertical) and trying to filter the Animal_Tables for 'Ready for Foster' animals from the selected Shelter on Screen-1, OnSelect the Button:
     
    Upon selecting the gallery, Items:
     
    This is not working for me. I need help.
    Filter(
        Animal_Tables,
        'Current Location' = SelectedShelter.ShelterName &&
        'Shelter Status'.Value = "Ready for Foster"
    )
     
     
     
     
    Power Fx for the third screen. This is where I succeeded to display the details of animal selected on the second screen, but failed to successfully implement the Foster Name and Location:
     
    OnSelect the button to submit the Foster Name and Location:
     
    If(
        IsBlank(TextInput_FosterName.Text) || IsBlank(TextInput_FosterLocation.Text),
        Notify("Foster claimer and location are required!", NotificationType.Error),
        Patch(
            Animal_Tables,
            SelectedAnimal,
            {
                'Shelter Status': {Value: "Claimed for Foster"},
                'Foster Claimer': TextInput_FosterName.Text,
                'Current Location': TextInput_FosterLocation.Text
            }
        );
        Notify("Animal successfully claimed for foster!", NotificationType.Success);
        Navigate(ViewAnimalsScreen, ScreenTransition.Fade)
    )
     
    )
     
     
    Note: The data type for the columns 'Shelter Status' is Choice, and for the column 'Current Location' is Text
     
    Please let me know should you require anything from my end.
     
    Thank you so much for your time and kind effort
    Biniyam
    Power_Fx_Screen_2.jpg
    Power_Fx_Screen_3_2nd_Part.jpg
    Power_Fx_Screen_3_1st_Part.jpg
  • Verified answer
    Michael E. Gernaey Profile Picture
    53,960 Moderator on at
     
    Original Question First
    • So I want to go back to the original issue, versus new stuff.
    • So what I guessed is correct, The TextInput_FosterName.Text is not valid
    • Can you please select the Control and validate what type is it. 
    • the issue is almost 100% that you need to use the .Value NOT .Text property
     
    Next Issue (Choice Problem)
    • The issue is you cannot set .Value to a String, you have to set it to an actual Choice
    • So you should use a Dropdown or a ComboBox and have the User Select one
    • Then you can use
    • { Value: Control.Selected.Value or in some cases Control.Selected) }
    • OR you have to do a Filter on the Choice Collect where the text value string is Ready for Foster
     
    And thats how you solve all your issues.
    Michael
     
     
     
     

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 482 Most Valuable Professional

#2
11manish Profile Picture

11manish 459

#3
Haque Profile Picture

Haque 331

Last 30 days Overall leaderboard