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 / Cannot write record to...
Power Apps
Answered

Cannot write record to (Excel) source: wrong data type

(1) ShareShare
ReportReport
Posted on by 22

Hello experts!

I've started building a PowerApp only a few days ago and am experiencing quite some difficulty. For starters the language settings make it so, that operators are completely different and do not match any of the feedback found on forums. Not sure how much of my issue can be brought back to the language question but it's good to know as you evaluate my question and code.

 

I'm trying to write a record to the External data source which is an Excel file. If I write this:

 

Patch(dataRaw; Defaults(dataRaw); {TeamA1: "test"}) 

 

it will work: the code is accepted. Of course I want it dynamically: the text to be recorded depends on the dropdown values. Drop down is named "1A_1":

 

Patch(dataRaw; Defaults(dataRaw); {TeamA1: '1_A1'.SelectedText}) 

 

Also when I declare a variable, the same error is given. Type argument TeamA1 does not match the expected type Text (translated from Dutch). In the Excel table, I have already changed the format of this particular column to 'Text'.

Attached is the powerapp. The item can be found on Screen 'Tafel1', it is the button upper corner right, to submit data.


Any help is appreciated. Thanks.

Categories:
  • AJ_Z Profile Picture
    3,711 Super User 2024 Season 1 on at

    Just checking this is an excel online datasource. And can you attach the blank excel? So I can try use it with the app

  • msdejong79 Profile Picture
    22 on at

    Online in the sense of it is pasted in OneDrive. I can attach the file but it won't be the source file, obviously. 

  • msdejong79 Profile Picture
    22 on at

    I've tried again, this time with the declared Variable and addition '.Value'. Even though we want Text format which stricly speaking isn't a value (not numeric anyway), this seems to work now. This means I can continue. Thanks for looking into this helper @AJ_Z . I may call upon you again some time in the future 🙂

  • CU-18081211-6 Profile Picture
    9,272 Moderator on at

    @msdejong79 

    Please do not use anymore SelectedText property as it is declared deprecated over 2 years ago. The correct formula is:

    Dropdown.Selected.Value 

    or if your items of dropdown is a table it should work :

    Dropdown.Selected.DesiredColumnNamefromItems

    Hope it helps !

  • AJ_Z Profile Picture
    3,711 Super User 2024 Season 1 on at

    Happy that it has been resolved feel free to reach out in the future 🙂

  • msdejong79 Profile Picture
    22 on at

    No that doesn't help me in the slightest 😂

    Now it gives me an error notification: incompatible types - contextvariables are now incompatible.

     

    msdejong79_0-1638696536320.png

     

    Which I interpret as such: it is no longer considered 'Text' type. I do need Text type for this one.

    Would appreciate further explanation @gabibalaban 

    Thanks!

  • CU-18081211-6 Profile Picture
    9,272 Moderator on at

    @msdejong79 ,

    You missed .Selected in your formula please check.

  • msdejong79 Profile Picture
    22 on at

    Doesn't make a difference:

     

    msdejong79_0-1638714144117.png

  • msdejong79 Profile Picture
    22 on at

    Also, the modules offered by microsoft use the .SelectedText property:

    msdejong79_0-1638720462861.png

    From module: Tables and formulas, Exercise - Use collections and manipulate tables.

  • Verified answer
    WarrenBelz Profile Picture
    156,566 Most Valuable Professional on at

    @msdejong79 ,

    Please listen to @gabibalaban when he refers to SelectedText - it is Deprecated - see this document and your app will stop working sometime in the future if you use it.

    Apart from that, this is a simple Variable setting so there are only two issues to look at: -

    • The Items of your Dropdowns 1_A1  and 1_A2 - ensure that the correct output is .Value. I notice the Items of 1_A2 is Spelers - which I assume is a List  - what field are you displaying in it?
    • If you have set the Variables varDDSpeler1_A1 and varDDSpeler1_A2 elsewhere before this as a Record (hence the incompatible types).

    You can also refer to both in the OnChange as Self (example)

    Set(
     varDDSpeler1_A1,
     Self.Selected.Value
    )

     

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

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 383 Super User 2026 Season 2

#2
Mohsin Ali Profile Picture

Mohsin Ali 356

#3
WarrenBelz Profile Picture

WarrenBelz 232 Most Valuable Professional

Last 30 days Overall leaderboard