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 Platform Community / Forums / Power Apps / text field does not ac...
Power Apps
Unanswered

text field does not accept text value unless through intermediate variable

(0) ShareShare
ReportReport
Posted on by 704

In this code

 

    UpdateContext({lGuid:GUID()})
    ;;UpdateContext({EhTest:ThisItem.Eenheid})
    ;;Collect(DitDierEvents;{
                             Omschrijving:ThisItem.Omschrijving
                            ;Aantal:ThisItem.Aantal
                            ;Eenheid:ThisItem.Eenheid
                            ;Memo:""
                            ;DierId:gDierRecord.identificatie_nummer_asiel
                            ;DocaDierId:gDierRecord.dier_id
                            ;EventDatum:Now()
                            ;EventtypeId:3
                            ;GUID:lGuid
                            })
;;Patch(
    [@DierEvent];
    Defaults([@DierEvent]);
    {
         UserEmail: User().Email
        ;EventDatum: Now()
        ;Memo:""
        ;Omschrijving:ThisItem.Omschrijving
        ;Aantal:Value(ThisItem.Aantal)
        ;LocatieId:If(!IsBlank(gKennel_asiel);gKennel_asiel.kennel_asiel_id;0)
        ;DocaDierId:gDierRecord.dier_id
        ;LocatieAsstring:If(!IsBlank(gKennel_asiel);gKennel_asiel.naam;"")
        ;DierId:gDierRecord.identificatie_nummer_asiel
        ;EventtypeId:3
        ;GUID:lGuid
        ;Eenheid:EhTest
    })
  

Creating a new record in the entity DierEvent Powerapps accepts EhTest in the last line, declared like this

;;UpdateContext({EhTest:ThisItem.Eenheid})

If I put ThisItem.Eenheid directly

 

;Eenheid:ThisItem.Eenheid

 

PA goes all red curlies on me while above the same value IS accepted in the collection DitDierEvents which is based upon the same table

I am trembling with excitement to get explained how this is logical 🙂

 

Categories:
I have the same question (0)
  • PowerAddict Profile Picture
    7,316 Most Valuable Professional on at
    Can you share the error message that you get?

    ---
    If you like this reply, please give kudos. And if this solves your problem, please accept this reply as the solution. Thanks!

    Hardit Bhatia
    https://thepoweraddict.com
  • HansHeintz Profile Picture
    704 on at

    It was a variable type mismatch error. But after closing the session and restarting it, it is gone. This variable, and the field in the entity, and the filed in the collection have never been anything but text.

    I often have errors that will not go away until all is closed and opened again, while is the code is correct.

    Rerunning on app start will not work.

    And the error often does not occur from running the program but just from changing a line after which changing the line back does not correct the errors. So the simple undo button restores yout code to the point without errors but still the errors persist. And the line you change can have nothing to do with the code that goes wrong.

    Makes debugging a nightmare because after wondering and searching what is wrong realising this might be the problem you loose another minute restarting the edit session.

  • PowerAddict Profile Picture
    7,316 Most Valuable Professional on at
    So its working fine now?

    ---
    If you like this reply, please give kudos. And if this solves your problem, please accept this reply as the solution. Thanks!

    Hardit Bhatia
    https://www.thepoweraddict.com
  • yashag2255 Profile Picture
    24,769 Super User 2024 Season 1 on at

    Hey @HansHeintz 

     

    Sometimes a lot of error occurs due to caching. It is a good practice to start a fresh session and always have the latest version of browser. If you feel a little inactivity or lag, you need to close the browser and open a fresh session. This solves the issue half of the time.

     

    Hope this Helps!

    If this reply has answered your question or solved your issue, please mark this question as answered. Answered questions helps users in the future who may have the same issue or question quickly find a resolution via search. If you liked my response, please consider giving it a thumbs up. THANKS!

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!

Congratulations to the April Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
Vish WR Profile Picture

Vish WR 1,033

#2
Valantis Profile Picture

Valantis 632

#3
11manish Profile Picture

11manish 607

Last 30 days Overall leaderboard